[mod_python] mod_python debug level message not logged

Graham Dumpleton graham.dumpleton at gmail.com
Tue Nov 18 17:34:26 EST 2008


2008/11/19 Annie Wang <aw1179 at yahoo.com>:
> Is there a way to change the LogLevel on the fly without restarting the
> apache server  ?  The loglevel is a read-only member so can't change that.

No.

> Thanks,
> Annie
>
> ________________________________
> From: Graham Dumpleton <graham.dumpleton at gmail.com>
> To: Annie Wang <aw1179 at yahoo.com>
> Cc: mod_python at modpython.org
> Sent: Monday, November 17, 2008 7:24:03 PM
> Subject: Re: [mod_python] mod_python debug level message not logged
>
> I believe the logging module has other handlers for that sort of
> stuff. One thing you will need to contend with though is that Apache
> is a multi process web server, so what ever mechanism you use will
> need to deal with possibility of multiple process trying to write to
> same log file. Because of this issue, you may want to look instead at
> a logger which uses syslog and configure syslog for where you want
> output to go.
>
> Graham
>
> 2008/11/18 Annie Wang <aw1179 at yahoo.com>:
>> Thank you for all your help.  My httpd.conf for LogLevel was set to debug
>> but I final figured what I did wrong; I made the change to the
>> ApacheLogHandler which didn''t work however I realized I made change to
>> the
>> wrong file so I tried the change to the log.py and voila, it works.
>>
>> Now my next question is, I want to log all the application messages to a
>> separate file not the apache error_log.  How do I go about doing this?
>>
>> Thanks,
>> Annie
>>
>> ________________________________
>> From: Graham Dumpleton <graham.dumpleton at gmail.com>
>> To: Annie Wang <aw1179 at yahoo.com>
>> Cc: mod python <mod_python at modpython.org>
>> Sent: Monday, November 17, 2008 5:18:06 PM
>> Subject: Re: [mod_python] mod_python debug level message not logged
>>
>> If they are not working, then you haven't set LogLevel directive in
>> Apache to sufficient high level to allow stuff through. Set:
>>
>>  LogLevel debug
>>
>> in main part of Apache configuration, ie., outside of VirtualHost, and
>> see if it makes a difference.
>>
>> PS, please use reply-all and keep discussion on the list.
>>
>> Graham
>>
>> 2008/11/18 Annie Wang <aw1179 at yahoo.com>:
>>> Hi Graham,
>>>
>>> So I can use apache.main_server.log_error() instead of
>>> apache.log_error(),
>>> right ?  I tried that and it didn't work.  I also tried
>>> apache.log_error(msg, level, apach.main_server) and didn't work either.
>>> Is there other alternative way to do logging for debug/info level
>>> messages
>>> ?
>>>
>>> Thanks,
>>> Annie
>>>
>>> ________________________________
>>> From: Graham Dumpleton <graham.dumpleton at gmail.com>
>>> To: Annie Wang <aw1179 at yahoo.com>
>>> Cc: mod_python at modpython.org
>>> Sent: Monday, November 17, 2008 4:55:31 PM
>>> Subject: Re: [mod_python] mod_python debug level message not logged
>>>
>>> 2008/11/18 Annie Wang <aw1179 at yahoo.com>:
>>>> I think my problem is record.__dict__['server'] raised an exception and
>>>> it
>>>> is just calling apache.log_error(record.getMessage(), level) without the
>>>> server parameter so only warn/error messages made it to the error_log.
>>>> So
>>>> my
>>>> question is, how do I get a hold of this server object other than from
>>>> the
>>>> request object ?
>>>
>>> If you are after server object for the virtual host, there is no other
>>> way of getting it except via request object.
>>>
>>> Only other server object available is that for main server, which from
>>> memory is apache.main_server.
>>>
>>> Graham
>>>
>>>
>>
>>
>
>


More information about the Mod_python mailing list