Question

This is likely just an oversight of a simple setting, but my apache error log has been filling up like this:

[Thu Oct 04 19:23:12 2012] [error] INFO:render.image_utils:aggdraw not available, using PIL native

There are several logs like this that appear, but here is the code for this one:

log = logging.getLogger("render.image_utils")
try:
    import aggdraw
    log.info("using aggdraw for point rendering")
except:
    log.info("aggdraw not available, using PIL native")

I expect it to classify the message as info in the apache log, not as an error with the word INFO after it. What do I need to get this logging working? If there is anything else I need to provide, please let me know. Thanks in advance.

Was it helpful?

Solution

You can't change this. The Python logging module knows nothing of and doesn't have access to the C level Apache API for logging messages at specific log levels. All it is able to do is send log output to stderr, which is routed into the Apache log system at error level.

In other words, it is a limitation you will have to live with unless you are going to write a special C extension module for Python which can hook into the Apache C level API for logging.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top