Hi

On Nov 9, 8:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I am trying to put up a queue (through a logging thread) so that all
> worker threads can ask it to log messages.

There is no need to do anything like this, the logging module is
thread safe and you can happily just create loggers in a thread and
use them, you can even use loggers that where created outside of the
thread.  We use logging from threads all the time and it works
flawlessly.

As mentioned by Vinay in your other thread the problem you have is
that your main thread exists before the worker threads, which makes
atexit run the exithandlers and logging registers the
logging.shutdown() function which does flush all logging buffers and
closes all handles (i.e. closes the logfile).  So as said before by
simply calling .join() on all the worker threads inside the main
thread your problem will be solved.  You might get away with making
your threads daemonic, but I can't guarentee you won't run into race
conditions in that case.  If  you want to be really evil you could get
into muddling with atexit...

Regards
Floris
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to