Commit 4cc80b95 authored by Arnaud Fontaine's avatar Arnaud Fontaine

squash! zope4: Configure logging similarly to what ZConfig used to do.

parent b4c86906
......@@ -184,12 +184,18 @@ def runwsgi():
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)
if args.event_log_file is None:
event_log_handler = logging.StreamHandler(sys.stdout)
else:
event_log_handler = logging.FileHandler(args.event_log_file)
event_log_handler.setFormatter(logging.Formatter(
"------\n%(asctime)s,%(msecs)d %(levelname)s %(name)s %(message)s",
"%Y-%m-%d %H:%M:%S"))
root_logger.addHandler(event_log_handler)
if args.access_log_file is None:
access_log_handler = logging.StreamHandler(sys.stdout)
else:
access_log_handler = logging.FileHandler(args.access_log_file)
access_log_handler.setLevel(logging.INFO)
access_log_logger = logging.getLogger('access')
......
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