c++log4cplus

log4cplus:ERROR Re-initializing default context after it has already been destroyed


I'm running Win32 application (it is unit test based on google test). At the end of the run, when test summary is printed, I've the following failure:

log4cplus:ERROR Re-initializing default context after it has already been destroyed.
The memory will be leaked.

It seems that log4cplus default context was already destroyed. Any idea how to prevent it from destroying until all my messages are printed?


Solution

  • I think you are logging from dtors of static/global objects which are called after main() is exited. This is not supported by log4cplus. It cannot be supported.