From ea65cb74013b241b8e925c8155f0b5c14dddc7da Mon Sep 17 00:00:00 2001 From: Paulo Nascimento Date: Sat, 20 Mar 2021 18:14:49 -0300 Subject: [PATCH] Log firewall rule call --- pkg/iptables/iptables.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/iptables/iptables.go b/pkg/iptables/iptables.go index 3115a4f..d339f20 100644 --- a/pkg/iptables/iptables.go +++ b/pkg/iptables/iptables.go @@ -370,11 +370,12 @@ func (c *Controller) Set(rules []Rule) error { protocolName = "ipv6" } - level.Debug(c.logger).Log("msg", "Applying Firewall Rule...", "Rule", c.rules[i].String(), "Protocol", protocolName) + var ruleString = rules[i].String() + level.Debug(c.logger).Log("msg", "Applying Firewall Rule...", "Rule", ruleString, "Protocol", protocolName) if err := rules[i].Add(c.client(proto)); err != nil { return fmt.Errorf("failed to add rule: %v", err) } - level.Debug(c.logger).Log("msg", "Firewall Rule applied.", "Rule", c.rules[i].String(), "Protocol", protocolName) + level.Debug(c.logger).Log("msg", "Firewall Rule applied.", "Rule", ruleString, "Protocol", protocolName) c.rules = append(c.rules, rules[i]) }