Log4J logs do not roll over the size (Tomcat / Windows, if any) when the system is under load, why could this be?

advertisements

Does anyone have some ideas of;

" why our log4j log file does not roll and keep growing huge in size?"

..It seems to only happen in one of our environments as well. Also,

The log file only does not roll when the machine is under load!

We've tested a few thing, searched Google and Stack Oevrflow to no avail.

Here's the things we are currently looking into;

"I read somewhere that some people see rolling not working if the app is started as a service but it works fine if its started from command line, could we test to make sure thats not what we are seeing (narrowing it down again)? There were a few people who saw this."

Our config is;

<appender name="file" class="org.apache.log4j.RollingFileAppender">
    <param name="file" value="D:/myloglocation/subfolder/mylog.txt"/>
    <param name="MaxFileSize" value="5MB"/>
    <param name="MaxBackupIndex" value="50"/>
    <param name="append" value="false"/>
    <param name="bufferedIO" value="false"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t] [%c{4}] %m%n"/>
    </layout>
</appender>

Does anyone have any ideas at all of what could be happening here?

PS: We are thinking of changing the bufferedIO flag above (for performance), but that couldn't be related right?


It appears you are running on windows? If so, another process reading the log file can prevent rolling. Do have any apps reading the log file, for say, monitoring purposes. Do you see any errors from Log4J in the console output from log4J at the rollover point.