pyrmid logging

58 views
Skip to first unread message

cropr

unread,
Jan 3, 2013, 11:48:19 AM1/3/13
to pylons-...@googlegroups.com
Does anyone know if is is possible to make pyramid putting its log messages no longer in the 'application' logger, but in a different one, preferable in a 'pyramid' logger, or in the root logger.   When I set the loglevel in my application to DEBUG my logfile is full with superfluous pyramid messages.   In Pylons this was a piece of cake

Wyatt Baldwin

unread,
Jan 3, 2013, 12:57:44 PM1/3/13
to pylons-...@googlegroups.com
On Thursday, January 3, 2013 8:48:19 AM UTC-8, cropr wrote:
Does anyone know if is is possible to make pyramid putting its log messages no longer in the 'application' logger, but in a different one, preferable in a 'pyramid' logger, or in the root logger.   When I set the loglevel in my application to DEBUG my logfile is full with superfluous pyramid messages.   In Pylons this was a piece of cake

Wouldn't the configuration be the same as in Pylons?

cropr

unread,
Jan 3, 2013, 3:15:04 PM1/3/13
to pylons-...@googlegroups.com


Wouldn't the configuration be the same as in Pylons?

In Pylons you had in the logging section of the development.ini file a pylons logger defined, that was used by the code in the pylons framework.  AFAIK there is no such support in the pyramid code to write to a pyramid logger.

Wyatt Baldwin

unread,
Jan 3, 2013, 11:48:44 PM1/3/13
to pylons-...@googlegroups.com
On Thursday, January 3, 2013 12:15:04 PM UTC-8, cropr wrote:


Wouldn't the configuration be the same as in Pylons?

In Pylons you had in the logging section of the development.ini file a pylons logger defined, that was used by the code in the pylons framework.  AFAIK there is no such support in the pyramid code to write to a pyramid logger.

Pylons and Pyramid both use stdlib logging. The logging config in your .ini files is just standard logging config; it's not Pyramid specific. You should be able to copy the logging config from a Pylons project and change "pylons" to "pyramid" and/or add the relevant sections for your package.

Mike Orr

unread,
Jan 4, 2013, 3:39:33 AM1/4/13
to pylons-...@googlegroups.com
To be clear, the logging is set up by pserve and pshell. To find the code:
grep -r logging pyramid/pyramid | grep import | grep -v '\.pyc'

In Pylons it was in some obscure place that threw people off because
they couldn't figure out why it worked in the normal "paster serve"
but not in mod_wsgi. I think we finally tracked it down in PasteDeploy
or some place.
Reply all
Reply to author
Forward
0 new messages