[mod_python] SQLAlchemy logging with mod_python

Eric Brunson brunson at brunson.com
Mon Oct 16 14:55:02 EDT 2006


Alex Greif wrote:
> Hi,
> is there a possibility to redirect sqlaachemy log messages to the
> error_log of mod_python?

I'm not aware of logging functions in SQLAlchemy, though there's a lot 
of SA that I'm not an expert in.  SQLAlchemy raises exceptions, which 
are in turn, printed out by the python interpreter, which goes to 
stdout.  You've obviously noticed that there is no stdout in mod_python, 
you would have to write an exception handler to catch any otherwise 
unhandled exception and write it to whatever error log you are writing 
to (see http://docs.python.org/lib/module-sys.html for the exc_info() 
function and exc_ family of functions).

My SQLAlchemy exceptions go to my apache error log by default, are you 
doing something to keep that from happening?  Perhaps catching the 
exception and not doing anything with it?

>
> Alex.
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list