Hi, I have the same problem some times. And I use log4cxx as a dll.
I think the problem appear when the appender have no time to roll the file. I saw this into the stderr. I'm not sure how to resolve the problem but I tried to add buffering, I have not had the problem any more since this change. Don't hesitate to keep me in touch. I can't reproduce the problem systematicaly so I'm not sure of this solution. Best regards. On Thu, Aug 25, 2011 at 16:58, log4cxx <log4...@gallandfamily.com> wrote: > 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 it’s 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 it’s 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 >