From b72f8b146146ed6bfbd09ff50936c0e1d6c3b1d9 Mon Sep 17 00:00:00 2001 From: Sigmund Augdal Date: Mon, 9 Dec 2013 15:19:40 +0100 Subject: [PATCH] Fix formatting for log file handlers --- dhcp_configurator.py | 1 + iptables_configurator.py | 1 + neighbors.py | 1 + 3 files changed, 3 insertions(+) diff --git a/dhcp_configurator.py b/dhcp_configurator.py index 3cc4213..d6508d4 100644 --- a/dhcp_configurator.py +++ b/dhcp_configurator.py @@ -38,6 +38,7 @@ class Generator(object): if logfile: handler = logging.handlers.RotatingFileHandler(logfile, maxBytes=10*1024**3, backupCount=5) + handler.setFormatter(logging.getLogger("").handlers[0].formatter) logging.getLogger("").addHandler(handler) self.range = [150, 200] self.prefix = "158.38.213." diff --git a/iptables_configurator.py b/iptables_configurator.py index 01f783b..abe1a58 100644 --- a/iptables_configurator.py +++ b/iptables_configurator.py @@ -26,6 +26,7 @@ class Generator(object): if logfile: handler = logging.handlers.RotatingFileHandler(logfile, maxBytes=10*1024**3, backupCount=5) + handler.setFormatter(logging.getLogger("").handlers[0].formatter) logging.getLogger("").addHandler(handler) # maps security group id from etcd to the name of a ipset containing its members self.group_members_groups = {} diff --git a/neighbors.py b/neighbors.py index 3f34876..4f8e959 100644 --- a/neighbors.py +++ b/neighbors.py @@ -105,6 +105,7 @@ def main(args): if args.daemonize: handler = logging.handlers.RotatingFileHandler(args.logfile, maxBytes=10*1024**3, backupCount=5) + handler.setFormatter(logging.getLogger("").handlers[0].formatter) logging.getLogger("").addHandler(handler) cache = NeighborCache(args.cert, args.key, args.cacert, args.interface, args.routers) -- GitLab