Re: Debug log doesn't work anymore

62 views
Skip to first unread message
Message has been deleted

george hu

unread,
Feb 17, 2013, 4:29:21 AM2/17/13
to pylons-...@googlegroups.com
Hi Lin,

It's hard to understand your questions. The issue is related to authorization log, or sqlalchemy log? What does the covering project mean?

On Thu, Feb 14, 2013 at 1:46 PM, Shu Lin <lin...@gmail.com> wrote:

Hi,

The debug log doesn't work for dependent libraries suddenly. For example, even I enabled debug_authorization, there was no authorization log printed out anymore. The log still works for the covering 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,

-Shu

===

[app:main]

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 =

    pyramid_jinja2

    pyramid_debugtoolbar

    pyramid_tm

debugtoolbar.hosts = 0.0.0.0/0


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


[server:main]

use = egg:pyramid#wsgiref

host = 0.0.0.0

port = 8080


# Begin logging configuration


[loggers]

keys = root, crossbow_py, sqlalchemy


[handlers]

keys = console, filelog


[formatters]

keys = generic


[logger_root]

level = INFO

handlers = console, filelog


[logger_crossbow_py]

level = DEBUG

handlers = 

qualname = crossbow_py


[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


[handler_filelog]

class = FileHandler

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

level = NOTSET

formatter = generic


[formatter_generic]

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


# End logging configuration

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Shu Lin

unread,
Feb 19, 2013, 2:05:32 PM2/19/13
to pylons-...@googlegroups.com
Geo,

Sorry, I didn't explain clearly.

Here is the problem.

The crossbow_py is my project, which uses sqlalchemy as a dependent library. From python package point of view, pyramid is a dependent library also, so as pyramid.authorization. Before,  I could get all the logs from sqlalchemy or pyramid.authorization. But, all of sudden, log stopped working for those these dependent packages. I can still get log in the project itself (crossbow_py) by using crossbow_py as the logger.

I guess there is a problem of paste parsing the development.ini. But, I don't know why.

Thanks,
-Shu

tonthon

unread,
Feb 20, 2013, 9:50:15 AM2/20/13
to pylons-...@googlegroups.com
Hi,
maybe providing the log section of your ini file could help to
understand your problem.

Le 19/02/2013 20:05, Shu Lin a �crit :

Shu Lin

unread,
Feb 23, 2013, 11:33:56 PM2/23/13
to pylons-...@googlegroups.com
I have posted the log in the original post already. Let me paste here also. :-)

Thanks a lot,
-Shu
On Wednesday, February 20, 2013 6:50:15 AM UTC-8, tonthon wrote:
Hi,
maybe providing the log section of your ini file could help to
understand your problem.

Le 19/02/2013 20:05, Shu Lin a �crit :

Shu Lin

unread,
Mar 4, 2013, 1:00:04 AM3/4/13
to pylons-...@googlegroups.com
Ok, at least, I found one setting affects my project. I need set "level" in the handler setting to be "NOTSET", instead of "DEBUG" to get debug_authorization back as below. But, from my understanding, the "DEBUG" level should match the debug log in authdebug_view function. Why doesn't it work?

Thanks a lot,
-Shu

diff --git a/code/xxx/yyy/development.ini b/code/xxx/yyy/development.ini
index a0bc00e..607003c 100644
--- a/code/xxx/yyy/development.ini
+++ b/code/xxx/yyy/development.ini
@@ -71,13 +71,13 @@ qualname = sqlalchemy.engine
 [handler_console]
 class = StreamHandler
 args = (sys.stderr,)
-level = DEBUG
+level = NOTSET
 formatter = generic
 
 [handler_filelog]
 class = FileHandler
 args = ('%(here)s/yyy.log','a')
-level = DEBUG
+level = NOTSET
 formatter = generic
 
 [formatter_generic]
Reply all
Reply to author
Forward
0 new messages