From c091399f5ee9d4bec5ba9d975b6af755ef83cd36 Mon Sep 17 00:00:00 2001 From: Unrud Date: Thu, 25 Aug 2016 04:29:39 +0200 Subject: [PATCH] Write log to stderr Be consistent with python's default behavior and play nice with CGI. --- logging | 2 +- radicale/log.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/logging b/logging index b2372147..be03f848 100644 --- a/logging +++ b/logging @@ -39,7 +39,7 @@ handlers = console,file # Console handler class = StreamHandler level = INFO -args = (sys.stdout,) +args = (sys.stderr,) formatter = simple [handler_file] diff --git a/radicale/log.py b/radicale/log.py index d1bae70f..6849af61 100644 --- a/radicale/log.py +++ b/radicale/log.py @@ -55,9 +55,9 @@ def start(name="radicale", filename=None, debug=False): # Default configuration, standard output if filename: logger.warning( - "Logging configuration file '%s' not found, using stdout." % + "Logging configuration file '%s' not found, using stderr." % filename) - handler = logging.StreamHandler(sys.stdout) + handler = logging.StreamHandler(sys.stderr) handler.setFormatter(logging.Formatter("%(message)s")) logger.addHandler(handler) if debug: