Commit 86582f1f authored by Vincent Pelletier's avatar Vincent Pelletier

zopewsgi: Fix msec log format

So that msec=1 is logged as ",001" and not as ",1".
parent 3b017fb0
...@@ -196,7 +196,8 @@ def runwsgi(): ...@@ -196,7 +196,8 @@ def runwsgi():
else: else:
event_log_handler = logging.FileHandler(args.event_log_file) event_log_handler = logging.FileHandler(args.event_log_file)
event_log_handler.setFormatter(logging.Formatter( event_log_handler.setFormatter(logging.Formatter(
"------\n%(asctime)s,%(msecs)d %(levelname)s %(name)s %(message)s", # XXX: why are msec treated separately from the rest of the timestamp ?
"------\n%(asctime)s,%(msecs)03d %(levelname)s %(name)s %(message)s",
"%Y-%m-%d %H:%M:%S")) "%Y-%m-%d %H:%M:%S"))
root_logger.addHandler(event_log_handler) root_logger.addHandler(event_log_handler)
...@@ -231,7 +232,8 @@ def runwsgi(): ...@@ -231,7 +232,8 @@ def runwsgi():
if conf.debug_mode: if conf.debug_mode:
console_handler = logging.StreamHandler(sys.stderr) console_handler = logging.StreamHandler(sys.stderr)
console_handler.setFormatter(logging.Formatter( console_handler.setFormatter(logging.Formatter(
"%(asctime)s,%(msecs)d %(levelname)s %(name)s %(message)s", # XXX: why are msec treated separately from the rest of the timestamp ?
"%(asctime)s,%(msecs)03d %(levelname)s %(name)s %(message)s",
"%Y-%m-%d %H:%M:%S")) "%Y-%m-%d %H:%M:%S"))
console_handler.setLevel(logging.NOTSET) console_handler.setLevel(logging.NOTSET)
root_logger.addHandler(console_handler) root_logger.addHandler(console_handler)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment