Re: #12012 Logging: request for comments

2010-09-29 Thread Russell Keith-Magee
On Wed, Sep 29, 2010 at 5:43 PM, Ian Lewis wrote: > Not sure I ever understood what Bikeshedding means properly, but fair > enough. For the history and meaning of the term, see here: http://bikeshed.com/ Yours, Russ Magee %-) -- You received this message because you are subscribed to the Goog

Re: #12012 Logging: request for comments

2010-09-29 Thread Ian Lewis
Not sure I ever understood what Bikeshedding means properly, but fair enough. My point was more to break it up the logging level by 2/3/400 classes of HTTP status codes and log each status code class with the same logging level. On Wed, Sep 29, 2010 at 1:06 AM, Alex Gaynor wrote: > I don't see ho

Re: #12012 Logging: request for comments

2010-09-28 Thread Russell Keith-Magee
On Wed, Sep 29, 2010 at 9:40 AM, Nick Phillips wrote: > On Wed, 2010-09-29 at 09:00 +0800, Russell Keith-Magee wrote: > >> These all strike me as messages appropriate for a warning -- they're >> all slightly concerning indications that you're either under some sort >> of attack, or at the very lea

Re: #12012 Logging: request for comments

2010-09-28 Thread Nick Phillips
On Wed, 2010-09-29 at 09:00 +0800, Russell Keith-Magee wrote: > These all strike me as messages appropriate for a warning -- they're > all slightly concerning indications that you're either under some sort > of attack, or at the very least that your users are having a bad > experience on your site

Re: #12012 Logging: request for comments

2010-09-28 Thread Russell Keith-Magee
On Tue, Sep 28, 2010 at 11:45 PM, Ian Lewis wrote: > Hi, > > On Tue, Sep 28, 2010 at 9:19 AM, Nick Phillips > wrote: >> I'm worried by the use of "warning" for all 4xx statuses. I think it >> still makes sense to use the "original" syslog level definitions[*] as a >> guide, and on there I'd sugge

Re: #12012 Logging: request for comments

2010-09-28 Thread Russell Keith-Magee
2010/9/29 Łukasz Rekucki : > On 28 September 2010 17:45, Ian Lewis wrote: >> Hi, >> >> On Tue, Sep 28, 2010 at 9:19 AM, Nick Phillips >> wrote: >>> I'm worried by the use of "warning" for all 4xx statuses. I think it >>> still makes sense to use the "original" syslog level definitions[*] as a >>>

Re: #12012 Logging: request for comments

2010-09-28 Thread Russell Keith-Magee
On Tue, Sep 28, 2010 at 7:43 PM, Luke Plant wrote: > On Sat, 2010-09-25 at 14:16 +0800, Russell Keith-Magee wrote: > >>  * The default logging configuration. Have I got the >> propagate/override options right for sensible defaults (both in global >> and new-project settings)? > > I just noticed th

Re: #12012 Logging: request for comments

2010-09-28 Thread Łukasz Rekucki
On 28 September 2010 17:45, Ian Lewis wrote: > Hi, > > On Tue, Sep 28, 2010 at 9:19 AM, Nick Phillips > wrote: >> I'm worried by the use of "warning" for all 4xx statuses. I think it >> still makes sense to use the "original" syslog level definitions[*] as a >> guide, and on there I'd suggest tha

Re: #12012 Logging: request for comments

2010-09-28 Thread Alex Gaynor
I don't see how a 302 because someone posted something is any less debug thann the 200 to serve thhhe get. Bikesheddinngly yours, Alex On Sep 28, 2010 11:45 AM, "Ian Lewis" wrote: Hi, On Tue, Sep 28, 2010 at 9:19 AM, Nick Phillips wrote: > I'm worried by ... I'm split on this myself but I th

Re: #12012 Logging: request for comments

2010-09-28 Thread Ian Lewis
Hi, On Tue, Sep 28, 2010 at 9:19 AM, Nick Phillips wrote: > I'm worried by the use of "warning" for all 4xx statuses. I think it > still makes sense to use the "original" syslog level definitions[*] as a > guide, and on there I'd suggest that some 4xx statuses would merit > "Info", some "Notice",

Re: #12012 Logging: request for comments

2010-09-28 Thread Luke Plant
On Sat, 2010-09-25 at 14:16 +0800, Russell Keith-Magee wrote: > * The default logging configuration. Have I got the > propagate/override options right for sensible defaults (both in global > and new-project settings)? I just noticed that the project template settings and the global settings are

Re: #12012 Logging: request for comments

2010-09-27 Thread Nick Phillips
On Sat, 2010-09-25 at 14:16 +0800, Russell Keith-Magee wrote: > So - have at it. I'm really excited by this; so let me know everywhere > I've messed up so that we can get this into trunk. Sorry, missed this before. A couple of comments... Logging config as last stage of settings loading is wher

Re: #12012 Logging: request for comments

2010-09-27 Thread Russell Keith-Magee
On Mon, Sep 27, 2010 at 11:16 PM, Luke Plant wrote: > Hi Russell, > > On Sat, 2010-09-25 at 14:16 +0800, Russell Keith-Magee wrote: > >> At this point, I'm calling for feedback, particularly on the following: >> >>  * logging config as the last stage of settings loading. Is this the >> right place

Re: #12012 Logging: request for comments

2010-09-27 Thread Hanne Moa
On 27 September 2010 17:16, Luke Plant wrote: > Anyway, this seems good to me, and I can't think of a better place.  For > the probably rare case of putting logging calls in your settings.py > (like Hanne Moa does), there is nothing to stop you setting up logging > yourself inside settings.py, whi

Re: #12012 Logging: request for comments

2010-09-27 Thread Luke Plant
Hi Russell, On Sat, 2010-09-25 at 14:16 +0800, Russell Keith-Magee wrote: > At this point, I'm calling for feedback, particularly on the following: > > * logging config as the last stage of settings loading. Is this the > right place? Can anyone think of a better place? In the context of runni

Re: #12012 Logging: request for comments

2010-09-27 Thread Vinay Sajip
On Sep 27, 1:15 am, Russell Keith-Magee wrote: > > On top of that, there is the purely architectural argument: > threadlocals are a global variable by any other name. They increase > coupling in the systems in which they are used. If an engineer came to > you and proposed a design that relied upo

Re: #12012 Logging: request for comments

2010-09-26 Thread mattimust...@gmail.com
On Sep 25, 7:46 pm, Antoni Aloy wrote: > > One last doubt, perhaps offtopic I have read logging module is slow, > good enough for 90% of applications but for the rest. Actually is > enough for me, but I can't see  to deal with log on big systems > Hi, If you are concerned about logging perfor

Re: #12012 Logging: request for comments

2010-09-26 Thread Russell Keith-Magee
On Mon, Sep 27, 2010 at 4:28 AM, Vinay Sajip wrote: > On Sep 26, 2:16 pm, Florian Apolloner wrote: >> I am aware of those; but let's imagine a 3rd party library which has >> no idea what a request is. In my logs I still want to know the request >> (even if it's just for formatting purposes…); so

Re: #12012 Logging: request for comments

2010-09-26 Thread Vinay Sajip
On Sep 26, 2:16 pm, Florian Apolloner wrote: > I am aware of those; but let's imagine a 3rd party library which has > no idea what a request is. In my logs I still want to know the request > (even if it's just for formatting purposes…); so I am looking for a > way to attach request specific info t

Re: #12012 Logging: request for comments

2010-09-26 Thread Florian Apolloner
On Sep 26, 4:13 pm, Jannis Leidel wrote: > On 26.09.2010, at 14:45, Florian Apolloner wrote: > Not sure I understand the problem, the app instances are initialized by the > app cache, at the same time as the proposed logging patch would import the > startup modules. Jupp, my mistake -- nevermin

Re: #12012 Logging: request for comments

2010-09-26 Thread Hanne Moa
On 25 September 2010 08:16, Russell Keith-Magee wrote: > At this point, I'm calling for feedback, particularly on the following: > >  * logging config as the last stage of settings loading. Is this the > right place? Can anyone think of a better place? Well naturally you can't log what happens in

Re: #12012 Logging: request for comments

2010-09-26 Thread Jannis Leidel
On 26.09.2010, at 14:45, Florian Apolloner wrote: > Hi, > > On Sep 25, 1:25 pm, Jannis Leidel wrote: >> Given the fact that the current implementation of the app cache does quite a >> few hoops to make it possible to implicitely import the models modules by >> iterating over INSTALLED_APPS, I'

Re: #12012 Logging: request for comments

2010-09-26 Thread Florian Apolloner
Hi, On Sep 26, 2:55 pm, Russell Keith-Magee wrote: > Yes, there is, and the logging calls I've included in the patch on > #12012 make use of it. All the logging calls take an 'extra' parameter > which can be used to insert relevant context into the logging call, > and can be used in a custom form

Re: #12012 Logging: request for comments

2010-09-26 Thread Russell Keith-Magee
On Sun, Sep 26, 2010 at 8:45 PM, Florian Apolloner wrote: > Hi, > Another question that came into my mind, after reading > http://www.reddit.com/r/Python/comments/ddkal/django_vs_web2py_what_do_you_use_and_why/c0zmxqz > (actually the whole thread, but that's the relevant post): Is there an > easy

Re: #12012 Logging: request for comments

2010-09-26 Thread Florian Apolloner
Hi, On Sep 25, 1:25 pm, Jannis Leidel wrote: > Given the fact that the current implementation of the app cache does quite a > few hoops to make it possible to implicitely import the models modules by > iterating over INSTALLED_APPS, I'd like to propose to rather move the logging > initializati

Re: #12012 Logging: request for comments

2010-09-25 Thread Jannis Leidel
On 25.09.2010, at 08:16, Russell Keith-Magee wrote: > Hi all, > > I've just uploaded a first draft at a patch introducing logging into > Django [1]. I'm calling for feedback on this patch. > > [1] http://code.djangoproject.com/attachment/ticket/12012/t12012-alpha1.diff > > This patch is heavily

Re: #12012 Logging: request for comments

2010-09-25 Thread Antoni Aloy
Hello, Actually what I'm used to do in my application is to have a logging configuration in the settings.py livel and import logging logging.getLogger(__name__) at the module level, so each module gets its own logger. In the settings level and via a local_settings file one can seat each logging

Re: #12012 Logging: request for comments

2010-09-25 Thread Russell Keith-Magee
Hi David, I'm not sure I completely follow - what exactly are you looking to have logged? The pattern that was matched by the request? As for raising a ticket - don't worry. About that at this point. For the moment, just keep he discussion on the ticket; if we decide that this is needed, we'll ro

Re: #12012 Logging: request for comments

2010-09-25 Thread David P. Novakovic
Hey mate, Great stuff! A cursory glance shows there isn't anything to log debug output from url resolution.. something I think I need to add.. I'll busy a ticket for it :) D On Sat, Sep 25, 2010 at 4:16 PM, Russell Keith-Magee wrote: > Hi all, > > I've just uploaded a first draft at a patch int

#12012 Logging: request for comments

2010-09-24 Thread Russell Keith-Magee
Hi all, I've just uploaded a first draft at a patch introducing logging into Django [1]. I'm calling for feedback on this patch. [1] http://code.djangoproject.com/attachment/ticket/12012/t12012-alpha1.diff This patch is heavily drawn from the work that Vinay Sajip has done in this area, but it a