Django log lines spamming syslog

29 views
Skip to first unread message

Scott Gould

unread,
Mar 23, 2012, 9:49:53 AM3/23/12
to Django users
Hi folks,

Our syslog has been filling up for some time with this stuff and we
only just noticed due to logrotate breaking on us. For what appears to
be every django request across all virtual hosts, we are getting a
pair of lines, like so (blank lines inserted by me):

Jan 27 14:48:52 cloweb01 apache2: SessionMiddleware.process_request -
id 0x7f6dabfb35d0 - cookie None - session
915ffaa7831b5de78876abb7746dfc1f - path /serverstatus/api/v1/status/
Jan 27 14:48:52 cloweb01 apache2: WSGIHandler.__call__ - id
0x7f6dabfb35d0 - cookie None - session
879f844cb6ea0213b445f60e11b22978 - path /serverstatus/api/v1/status/

Jan 27 14:48:54 cloweb01 apache2: SessionMiddleware.process_request -
id 0x7f6dab5abb10 - cookie 3f7dc260e50d4da7a6168627f087fa96 - session
3f7dc260e50d4da7a6168627f087fa96 - path /
Jan 27 14:48:55 cloweb01 apache2: WSGIHandler.__call__ - id
0x7f6dab5abb10 - cookie 3f7dc260e50d4da7a6168627f087fa96 - session
3f7dc260e50d4da7a6168627f087fa96 - path /

Jan 27 14:48:55 cloweb01 apache2: SessionMiddleware.process_request -
id 0x7f6dac318950 - cookie ad94336c4f21abd813f52d5a6f8d3f42 - session
ad94336c4f21abd813f52d5a6f8d3f42 - path /
Jan 27 14:48:55 cloweb01 apache2: WSGIHandler.__call__ - id
0x7f6dac318950 - cookie ad94336c4f21abd813f52d5a6f8d3f42 - session
ad94336c4f21abd813f52d5a6f8d3f42 - path /

There's nothing I'm aware of in my own code that's creating these
lines, and my knowledge about the inner workings of the various
components in play decreases as you move further away from Django.
Could anyone hazard a guess as to where this might be coming from? We
don't explicitly/knowlingly send anything to syslog from apache. The
vitals: Ubuntu 10.04, Apache/2.2.14, mod_wsgi 2.8, Python 2.6.5,
Django 1.2.

Thanks all.

Reinout van Rees

unread,
Mar 23, 2012, 11:36:47 AM3/23/12
to django...@googlegroups.com
On 23-03-12 14:49, Scott Gould wrote:
>
> Our syslog has been filling up for some time with this stuff and we
> only just noticed due to logrotate breaking on us. For what appears to
> be every django request across all virtual hosts, we are getting a
> pair of lines, like so (blank lines inserted by me):
>
> Jan 27 14:48:52 cloweb01 apache2: SessionMiddleware.process_request -
> id 0x7f6dabfb35d0 - cookie None - session
> 915ffaa7831b5de78876abb7746dfc1f - path /serverstatus/api/v1/status/
> Jan 27 14:48:52 cloweb01 apache2: WSGIHandler.__call__ - id
> 0x7f6dabfb35d0 - cookie None - session
> 879f844cb6ea0213b445f60e11b22978 - path /serverstatus/api/v1/status/

I looked at django/contrib/sessions/middleware.py and there's no logging
or printing happening there.

That the syslog ends up with this info probably means that django prints
it out on the console, which would normally end up in your apache's
error log. Probably you configured apache to send it to the syslog instead.

Printing on the console means "print ..." or a logger that's configured
to print to the console. Did you do the latter?


My guess: someone put a print statement in
django/contrib/sessions/middleware.py for debug purposes. So check the
django that your site is using and see if you have to beat someone with
a stout stick.


Reinout

--
Reinout van Rees http://reinout.vanrees.org/
rei...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

Scott Gould

unread,
Mar 23, 2012, 11:47:00 AM3/23/12
to Django users
Nail, meet head.

Thanks! I was thinking along similar lines but stupidly checked
everywhere (my code, apache confs, etc.) except the django source on
the server itself.
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
Reply all
Reply to author
Forward
0 new messages