RotatingFileHandler issue

Max Lynch ihasmax at gmail.com
Wed Oct 14 19:23:28 CEST 2009


I never got a response back from this, but I'm noticing even more odd
behavior, see inline:

On Wed, Sep 30, 2009 at 4:38 PM, Max Lynch <ihasmax at gmail.com> wrote:

> Hi.
> I have a RotatingFileHandler for my logging system.  I have it set to
> rotate once the file becomes 5MB in size.  Here is the conf line I have in
> my logging config file:
>
> [handler_fileHandlerDebugNoRequest]
> class=handlers.RotatingFileHandler
> formatter=formatterNoRequest
> args=('/web/logs/gobuzz_debug.log', 'a', 5242880, 8)
>
> However, my logging folder contains these files:
> -rw-r--r-- 1 www-data www-data 566K Sep 30 16:35 gobuzz_debug.log
> -rw-r--r-- 1 www-data www-data 4.2M Sep 30 16:35 gobuzz_debug.log.1
> -rw-r--r-- 1 www-data www-data 572K Sep 30 16:36 gobuzz_debug.log.2
> -rw-r--r-- 1 www-data www-data 558K Sep 30 16:35 gobuzz_debug.log.3
> -rw-r--r-- 1 www-data www-data 3.7K Sep 29 20:52 gobuzz_debug.log.4
> -rw-r--r-- 1 www-data www-data 3.7K Sep 29 20:52 gobuzz_debug.log.5
> -rw-r--r-- 1 www-data www-data 566K Sep 30 16:36 gobuzz_debug.log.6
> -rw-r--r-- 1 www-data www-data 1.6M Sep 30 16:36 gobuzz_debug.log.7
> -rw-r--r-- 1 www-data www-data  45K Sep 29 20:50 gobuzz_debug.log.8
> -rwxrwxrwx 1 www-data www-data 691K Sep 28 09:39 gobuzz_error.log
>
> Clearly, the files are rotating far before they hit 5MB.  The consequence
> of such being that I'm losing a lot of log data.  What gives?  Am I doing
> something wrong?
>

For some reason, my Apache2/mod_wsgi/django system is writing to all of the
separate rotated files at once.  I can't detect a pattern, but some times,
for example, logging data goes into "gobuzz_debug.log.8" and some times they
go into "gobuzz_debug.log.5", rather than only going to gobuzz_debug.log and
rotating after 5MB.

Does anyone have any ideas? Here are my formatter sections if it matters:
[formatter_formatterNoRequest]
format=%(asctime)s - %(mymodule)s:%(mylineno)d - %(levelname)s - %(message)s
datefmt=%a, %d %b %Y %I:%M:%S %p




> Thanks,
> Max
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091014/c800aae1/attachment.html>


More information about the Python-list mailing list