At first we were duplicating log4cxx initialization in our dynamically loaded DLLs as well. We saw problems with this, so we switched to a single initialization. We were already using a wrapper class for LoggerPtr. When we load in our dynamically loaded DLLs, we go through all the wrapper instances and redo Logger::getLogger for the underlying member.
Hope this helps, Andy On Tue, Aug 9, 2011 at 5:06 PM, Shyam Pabbathi <spabb...@brocade.com> wrote: Hi, We are using log4cxx in our application running on Windows. The maximum size for log file is defined in log4j.properties as follows: log4j.appender.R.MaxFileSize=1000KB The log file size goes up to more than 1000 kb to 13gb some times. We have seen this issue several times, but unable to recreate it consistently. Our application consists of two components: 1. Shared Library file DLL (It includes the log4cxx, apr libraries statically) and it has its own initialization sequence for log4cxx. 2. Executable file and it linked to DLL file dynamically mentioned above (It also includes the log4cxx, apr libraries statically) and it has its own initialization sequence for log4cxx). Here is the sequence of log4cxx in both executable and DLL: log4cxx::BasicConfigurator::configure(); log4cxx::File cfgFile("conf/log4j.properties"); log4cxx::PropertyConfigurator::configureAndWatch(cfgFile, 60000); We had to add initialization sequence in both executable and DLL in order to get log message from both of them (Executable and DLL). Any help is appreciated to stop the log file grows more than 1000 kb. Note: We never experienced this issue when we link our DLL and executable statically. But, we have to make our library as DLL as per our requirements. thanks, -- Shyam