fixed bug in logger where formatter using old attributes

This commit is contained in:
Alan Hamlett 2013-09-22 15:03:01 -07:00
parent d3ac82dfd0
commit 28f86f7350

View file

@ -69,6 +69,15 @@ def setup_logging(args, version):
logger = logging.getLogger() logger = logging.getLogger()
set_log_level(logger, args) set_log_level(logger, args)
if len(logger.handlers) > 0: if len(logger.handlers) > 0:
formatter = JsonFormatter(datefmt='%a %b %d %H:%M:%S %Z %Y')
formatter.setup(
timestamp=args.timestamp,
isWrite=args.isWrite,
targetFile=args.targetFile,
version=version,
plugin=args.plugin,
)
logger.handlers[0].setFormatter(formatter)
return logger return logger
logfile = args.logfile logfile = args.logfile
if not logfile: if not logfile: