You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by Jeff Apple <ja...@paradise.net.nz> on 2004/09/28 11:32:58 UTC

Patch for rolling file appender

When compiled using the Sun Forte compiler, the rolling file appender 
rolls the files on each message. tellp() has to be cast to long for the 
comparison to be valid. I haven't tried any other compilers. Patch below.

--- rollingfileappender.cpp     2004-09-14 21:43:13.000000000 +1200
+++ rollingfileappender.cpp     2004-09-14 21:43:07.000000000 +1200
@@ -102,7 +102,7 @@
void RollingFileAppender::subAppend(const spi::LoggingEventPtr& event)
{
       FileAppender::subAppend(event);
-       if(!fileName.empty() && ofs.tellp() >= maxFileSize)
+       if(!fileName.empty() && ((long)ofs.tellp()) >= maxFileSize)
       {
               rollOver();
       }