﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25775	Method log_message in server.py uses sys.stderr.write, not logging	Aleksey @soar Smyrnov	nobody	"I try to capture all log output of my Django-based project, but logged requests like:

{{{
[19/Nov/2015 12:30:12] ""GET / HTTP/1.1"" 200 12898
[19/Nov/2015 12:37:32] ""GET /favicon.ico HTTP/1.1"" 302 0
}}}

can't be catched, reformatted, etc. I found line, where this log caused:

{{{#!python
    def log_message(self, format, *args):
        """"""Log an arbitrary message.

        This is used by all other logging functions.  Override
        it if you have specific logging wishes.

        The first argument, FORMAT, is a format string for the
        message to be logged.  If the format string contains
        any % escapes requiring parameters, they should be
        specified as subsequent arguments (it's just like
        printf!).

        The client ip and current date/time are prefixed to
        every message.

        """"""

        sys.stderr.write(""%s - - [%s] %s\n"" %
                         (self.client_address[0],
                          self.log_date_time_string(),
                          format%args))
}}}

So, why you use `sys.stderr.write()`, not `logging.debug()/info()/warn()/etc`?"	Cleanup/optimization	closed	HTTP handling	1.8	Normal	duplicate	log, logging, stdout		Unreviewed	0	0	0	0	0	0
