Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Logging, again...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Vlad K.  
View profile  
 More options Sep 11 2012, 6:41 pm
From: "Vlad K." <v...@haronmedia.com>
Date: Wed, 12 Sep 2012 00:41:34 +0200
Local: Tues, Sep 11 2012 6:41 pm
Subject: Logging, again...

Hi all,

I'm having a bit of an issue with logging. I did this (a trick I picked
up from a site to enable logging under uwsgi):

    __init__.py
    --------------------
    def main(global_config, **settings):
         """ Main WSGI application.
         """
         logging.config.fileConfig(settings["logging.config"])
    ....

    development.ini
    --------------------
    logging.config = %(here)s/development.ini

    ...

    # Begin logging configuration

    [loggers]
    keys = root,sqlalchemy

    [handlers]
    keys = console

    [formatters]
    keys = generic

    [logger_root]
    level = DEBUG
    handlers = console

    [logger_sqlalchemy]
    level = INFO
    handlers =
    qualname = sqlalchemy.engine
    # "level = INFO" logs SQL queries.
    # "level = DEBUG" logs SQL queries and results.
    # "level = WARN" logs neither.  (Recommended for production systems.)

    [handler_console]
    class = StreamHandler
    args = (sys.stderr,)
    level = NOTSET
    formatter = generic

    [formatter_generic]
    format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s]
    %(message)s

    # End logging configuration

Now, if I include logging.config.fileConfig() line in __init__ I have to
specifically enable loggers for namespaces in development.ini, the root
logger won't catch all. For example, I've disabled debugtoolbar in dev,
and in case of exceptions I get nothing on the console unless I add a
[logger_waitress] section (with logger key set, qualname, etc...).

If I remove that line (basically, disable logging configuration),
logging under Waitress shows root logger catching all (that is not
overriden).

What am I doing wrong?

--

.oO V Oo.

Work Hard,
Increase Production,
Prevent Accidents,
and
Be Happy!  ;)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philip Jenvey  
View profile  
 More options Sep 14 2012, 2:12 pm
From: Philip Jenvey <pjen...@underboss.org>
Date: Fri, 14 Sep 2012 11:12:03 -0700
Local: Fri, Sep 14 2012 2:12 pm
Subject: Re: Logging, again...

On Sep 11, 2012, at 3:41 PM, Vlad K. wrote:

It's not apparent to me what's wrong. With a root logger set to DEBUG you should probably be seeing those messages. You may want to try using the logging_tree package as a visual aid:

http://pypi.python.org/pypi/logging_tree

--
Philip Jenvey


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marius Gedminas  
View profile  
 More options Sep 16 2012, 1:47 am
From: Marius Gedminas <mar...@gedmin.as>
Date: Sun, 16 Sep 2012 08:46:57 +0300
Local: Sun, Sep 16 2012 1:46 am
Subject: Re: Logging, again...

On Wed, Sep 12, 2012 at 12:41:34AM +0200, Vlad K. wrote:
> Hi all,

> I'm having a bit of an issue with logging. I did this (a trick I
> picked up from a site to enable logging under uwsgi):

>    __init__.py
>    --------------------
>    def main(global_config, **settings):
>         """ Main WSGI application.
>         """
>         logging.config.fileConfig(settings["logging.config"])

Would your issue go away if you tried

          logging.config.fileConfig(settings["logging.config"],
                                    disable_existing_loggers=False)

?

> Now, if I include logging.config.fileConfig() line in __init__ I
> have to specifically enable loggers for namespaces in
> development.ini, the root logger won't catch all. For example, I've
> disabled debugtoolbar in dev, and in case of exceptions I get
> nothing on the console unless I add a [logger_waitress] section
> (with logger key set, qualname, etc...).

Yeah, sounds like you hit this:
http://mg.pov.lt/blog/logging-fileconfig-gotcha.html

Marius Gedminas
--
Given enough eyeballs all bugs are shallow.
                -- Eric S. Raymond, "The Cathedral and the Bazaar"

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vlad K.  
View profile  
 More options Sep 17 2012, 8:04 am
From: "Vlad K." <v...@haronmedia.com>
Date: Mon, 17 Sep 2012 14:04:19 +0200
Local: Mon, Sep 17 2012 8:04 am
Subject: Re: Logging, again...
On 09/16/2012 07:46 AM, Marius Gedminas wrote:

> Yeah, sounds like you hit this:
> http://mg.pov.lt/blog/logging-fileconfig-gotcha.html

Yes, that's it. My google-fu must have failed me. :)

Thanks a lot, that fixed my problem!

--

.oO V Oo.

Work Hard,
Increase Production,
Prevent Accidents,
and
Be Happy!  ;)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »