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();
      }



Reply via email to