fixed bug in logger where formatter using old attributes
This commit is contained in:
parent
d3ac82dfd0
commit
28f86f7350
1 changed files with 9 additions and 0 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue