How to wait for AsyncAppender to finish all its tasks?
This post has NOT been accepted by the mailing list yet.
I am newbie to log4cxx. I am playing with AsyncAppender and feel it is really beneficial in terms of performance. I notice that when AsyncAppender starts working, a new thread is created for dispatching the messages so that the main thread will not be blocking for file writing.
My question is how to wait for the all the AsyncAppenders to finish their work. For example the main thread want to quit right now and before it quits I want to make sure all the pending file writing finished by the AsyncAppenders. I know that AsyncAppender has close method which will wait for the dispatch thread to finish its work. But in case there are a few AsyncAppenders working for a few loggers and I did not record the LoggerPtr and the AppenderPtr in anywhere (the loggers and appenders are all configured by xml file). Does log4cxx support an API to uninitialise the log4cxx so that everything is cleaned up gracefully?