feature request - use logging in WSGIRequestHandler

183 views
Skip to first unread message

Martín Massera

unread,
May 27, 2014, 3:35:25 PM5/27/14
to django-d...@googlegroups.com
Hi sometimes when you are developing you get so much output in the console, especially when you have many medias on the page. It would be nice to use the logging system to remove those messages, but right now stderr is being used.

Using the logging system for choosing whether we want to see this output or not sounds like a natural solution, right? 

http://stackoverflow.com/questions/23833642/django-how-to-filter-out-get-static-and-media-messages-with-logging/23845219

take care!

Russell Keith-Magee

unread,
May 28, 2014, 9:41:02 PM5/28/14
to Django Developers
Well, logging *could* be used for this, sure. 

However, there's a cost - we'd be adding the requirement for a logging configuration for something that is only ever used during development. So we'd end up complicating the process of deploying the devserver, which is one of those things that is supposed to Just Work™ out of the box.

I *think* this would also mean losing the colorisation of devserver messages, and for me, colorisation of output of the devserver is a higher priority than the need to filter specific lines out of devserver output (don't quote me on this one though -- it might be possible to preserve colorisation. Some experimentation may be required).

It's also a feature that can be achieved using pipes and grep, which would be more in line with the broader Unix philosophy. 

In summary: I don't personally see a particularly compelling case for this feature. However, the real test will be whether you can come up with an implementation that doesn't overly complicate the deployment of the devserver for the case that *most* users need it - a simple server that Just Works™. 

Yours,
Russ Magee %-)

Michael Manfre

unread,
May 29, 2014, 8:55:16 AM5/29/14
to django-d...@googlegroups.com
Today I learned that the devserver messages are supposed to be in color.

Having all output from Django controlled by logging would be a nice improvement.

Regards,
Michael Manfre


--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAJxq8482r1TJy9rv7xGimCz27mVqtkbC6M3u%2BUirWeVKQBA5kQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Tino de Bruijn

unread,
May 29, 2014, 10:38:06 AM5/29/14
to django-d...@googlegroups.com

On Thu, May 29, 2014 at 3:40 AM, Russell Keith-Magee <rus...@keith-magee.com> wrote:
However, there's a cost - we'd be adding the requirement for a logging configuration for something that is only ever used during development. So we'd end up complicating the process of deploying the devserver, which is one of those things that is supposed to Just Work™ out of the box.

I *think* this would also mean losing the colorisation of devserver messages, and for me, colorisation of output of the devserver is a higher priority than the need to filter specific lines out of devserver output (don't quote me on this one though -- it might be possible to preserve colorisation. Some experimentation may be required).

Isn't this easy to set up with defaults for logging? Like we already do for `django.request` and `django.security`[1]?

And it appears colouring log messages is possible with a custom formatter [2].

+1 from me to have more control over the output of the devserver.


Tino

charettes

unread,
Nov 7, 2015, 5:03:01 AM11/7/15
to Django developers (Contributions to Django itself)
FWI a new ticket[1] with what looks like a sane implementation to add this level of logging to the runserver command has been created.

I'll make sure to copy all the concerns raised by Russ over there and you might want to chime in the review process.

Simon

[1] https://code.djangoproject.com/ticket/25684
Reply all
Reply to author
Forward
0 new messages