Graham Dumpleton wrote .. > It is only recently that I realised that a nested function like that > could access stack variables of the enclosing function.
I should have added, "when the execution of the enclosing function has already finished and the nested function is called at a later time". I'm not that stupid that I didn't know the nested function could access data in enclosing function when enclosing function hadn't returned yet. :-) Anyway, I have attached an updated version of my log handler. This fixes the issue with log levels that don't exactly map to any defined level. Eliminates the explicit stack for storing request objects and in general tries to make the module durable in the face of any module reloading scheme for mod_python which exists now or which may exist in the future. You can either use the default "mod_python" log it sets up, or create explicit instances of ApacheLogHandler and add them against any log within the hierarchy that you want. Any feedback most welcome. Graham
apache_log_handler.py
Description: Binary data