Re: log doesn't work

Skip to first unread message

Shu Lin

Apr 28, 2013, 3:09:07 AM4/28/13
I basically identified it is a paste parsing ini file problem since if I put below into code, things start working:

import logging

log = logging.getLogger(__name__)


But, we can see, in the ini file, I have set log level at least to INFO level for every module.

What's the problem of ini file parsing? How to debug it?

Thanks a lot,

On Thursday, April 25, 2013 9:57:24 PM UTC-7, Shu Lin wrote:


The debug log doesn't work for dependent libraries suddenly. The log still works for the main project, in this case, it is "crossbow_py". But, not for sqlalchemy anymore. What's wrong with my configuration? Below is my development.ini.

Thanks a lot,




use = egg:crossbow_py

reload_templates = true

debug_authorization = true

debug_notfound = false

debug_routematch = false

debug_templates = false

default_locale_name = en

jinja2.directories = crossbow_py:templates

pyramid.includes =




debugtoolbar.hosts =

sqlalchemy.url = sqlite:///%(here)s/crossbow.sqlite

session.type = cookie

session.key = crossbow

session.encrypt_key = mysecretencryptionkey

session.validate_key = mysecretvalidationkey

session.cookie_on_exception = true


use = egg:pyramid#wsgiref

host =

port = 8080

# Begin logging configuration


keys = root, crossbow_py, sqlalchemy


keys = console, filelog


keys = generic


level = INFO

handlers = console, filelog


level = DEBUG

handlers = 

qualname = crossbow_py


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.)


class = StreamHandler

args = (sys.stderr,)

level = NOTSET

formatter = generic


class = FileHandler

args = ('%(here)s/crossbow.log','a')

level = NOTSET

formatter = generic


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

# End logging configuration

Taavi Burns

Apr 28, 2013, 7:13:57 AM4/28/13
to Shu Lin,
If you're having issues with log messages and levels etc, I highly recommend Brandon Rhodes' logging_tree module:

Python's logging is a complex beast; there are talks on it at every PyCon I've been at.

Good luck!

You received this message because you are subscribed to the Google Groups "Paste Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

Shu Lin

Apr 30, 2013, 2:17:56 AM4/30/13
to, Shu Lin

The logging tree really helps on understanding of the log. Now, I know the logging is really a beast.

Thanks a lot,
Reply all
Reply to author
0 new messages