On Fri, Oct 21, 2011 at 5:51 AM, Chris McDonough <chr...@plope.com> wrote:
> On Fri, 2011-10-21 at 02:50 -0700, Mattias wrote:
>> I am setting up a little test application using pylons and pyramids, I
>> am currently using mod_wsgi under apache2 as the server. So far
>> everything works perfectly except my logging. I have tried to change
>> the
>>
>> On the page 
>> http://docs.pylonsproject.org/projects/pyramid/1.2/narr/logging.html
>> is says "This chapter assumes you’ve used a scaffold to create a
>> project which contains development.ini and production.ini files which
>> help configure logging. All of the scaffolds which ship along with
>> Pyramid do this."
>>
>> Later on it says "The paster serve command calls the
>> logging.fileConfig function using the specified ini file if it
>> contains a [loggers] section (all of the scaffold-generated .ini files
>> do). logging.fileConfig reads the logging configuration from the ini
>> file upon which paster serve was invoked."
>>
>> I use paster in my wsgi file, http://pastie.org/2734261, but I know
>> you can also use paster as the server.
>>
>> Will the automatic logging configuration only work if I am using
>> paster as the server?
>
> In short, yes.  But technically, paster is not the server.  "paster
> serve" *runs* a server, but it is not a server.  Automatic logging
> configuration takes place when you use "paster serve".  If you don't use
> "paster serve", it doesnt happen.

"paster serve" does the equivalent of:

import logging.config
logging.config.fileConfig(INI_FILE)

You can put that in your startup code somewhere.

Python 2.7 also has a new 'dictConfig' function that takes a nested
dict structure instead of a filename, if you find that more
convenient.

-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to