1. cherrypy
  2. CherryPy
Issue #866 resolved

Error *and* access log printed to stderr

created an issue

In 3.1.0 final both, the error and the access log are printed to stderr. As already stated in #747, the access log should go to stdout and the error log to stderr (only then, both of them were printed to stdout).

A workaround is

cherrypy.log._set_screen_handler(cherrypy.log.access_log, False) cherrypy.log._set_screen_handler(cherrypy.log.access_log, True, stream=sys.stdout)

but using underscore-methods is not very user-friendly. Furthermore, this behaviour was new in 3.1.0 final (if I remember correctly, beta 3 did it fine)

Comments (4)

  1. Anonymous

    Here is the fix:

    --- cherrypy/_cplogging.py      (Revision 2082)
    +++ cherrypy/_cplogging.py      (Arbeitskopie)
    @@ -124,7 +124,7 @@
             if enable:
                 if not h:
                     if stream is None:
    -                    stream=sys.stderr
    +                    stream=sys.stdout
                     h = logging.StreamHandler(stream)
                     h._cpbuiltin = "screen"

    mfg Betz Stefan

  2. Log in to comment