[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-14 Thread James Kesser

James Kesser added the comment:

My approach was just as outlined in the first few paragraphs here, just naming 
loggers for each module using __name__:

http://docs.python.org/2/howto/logging.html#logging-advanced-tutorial

If this is not recommended the documentation should be updated to reflect this.

In my project, I can work around this by having all modules use the same logger 
instance and just printing the module name in the Formatter instead of the 
logger name.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17407
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-14 Thread James Kesser

James Kesser added the comment:

Thanks for quick response!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17407
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-12 Thread James Kesser

New submission from James Kesser:

I believe I have come across a bug with RotatingFileHandler in 
logging/handlers.py

The attached script shows that when you are logging using RotatingFileHandler 
pointed at the same file from multiple logger instances, it works at first 
showing logging events from each. However, after the first rotation occurs, the 
events seem to be group together and do not get logged in order. Instead they 
are logged in groups according to which instance is performing the logging.

NOTE: While searching for a bug report of this issue I was flooded with issues 
relating to multiple processes. This is not the case here. I have attached a 
script and the log files that are generated when running this as a single 
process / thread.

first log file contains:

a aaa...
b bbb...
a aaa...
b bbb...
a aaa...
b bbb...
a aaa...
b bbb...
a aaa...

subsequent log files contain events all from either a or b only, not 
intertwined like you would expect.

I first noticed this using v2.4.3 of the logging library, however I was able to 
reproduce this on 2.7 and 3.3 as well.

--
components: Library (Lib)
files: rotating_file_handler_test.tar
messages: 184061
nosy: James.Kesser
priority: normal
severity: normal
status: open
title: RotatingFileHandler issue when using multiple loggers instances (but one 
process/thread) to the same file
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file29393/rotating_file_handler_test.tar

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17407
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com