I have a really curious problem using the Logging API. My code is the following :
- - - - - - - - - -
Channel* file = factory.createChannel("FileChannel");
file->setProperty(FileChannel::PROP_PURGEAGE, "10 minutes");
Channel* asyncFile = factory.createChannel("AsyncChannel");
// somewhere else
t.start(Empty()); // Empty is a Runnable doing nothing
- - - - - - - -
That works fine in a single threaded environment. But when I try to create another thread, even if this thread doesn't access the logger, or worse, does nothing, the application crashes with the Windows code 3 ("The system cannot find the path specified."). If I suppress the line "t.start(Empty());", that works fine.
The problem seems to appear only with the AsyncChannel. I think it is a determinitic behavior, as I can reproduce it as much as I want (and it allways occurs).
A subsidiary question : can I log to an AsyncChannel from several threads without explicit synchronization ?
Thanks very much.
I really like Poco !