[mod_python] problems with logging

Camilo Telles camilot at terra.com.br
Sat Aug 16 07:16:42 EDT 2008


Sirs,

I have an annoying problem happening with mod_python and logging.
Here is the code:
===========================================
import logging
from mod_python import util

def index(req, email):
        logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s;%(message)s',
                    filename='log_email.txt',
                    filemode='a')
        logging.info(email)
        logging.shutdown()

        util.redirect(req, 'http://dummy/download.html')
======================================

What happens: sometimes the logs occurs, sometimes it not. It´s completely random. 

I´m using:

Apache/2.2.8 (Ubuntu) 
mod_python/3.3.1 
Python/2.5.2

Any clue? I need to do some kind of flush? If yes, how? 

Thanks in advance.

Camilo





More information about the Mod_python mailing list