I know the DailyRollingFileAppender
will do it for me.But it does not support the maximum file size when my file size was reached to the specified size.
<appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
<param name="Threshold" value="ALL" />
<param name="MaxFileSize" value="50KB" />
<param name="MaxBackupIndex" value="10" />
<param name="File" value="F:/logs/Testing/MyProject.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{MMM-dd-yyyy HH:mm:ss:SSS} %-5p %m%n"/>
</layout>
</appender>
I want to create my file name to be like MyProject_12.12.2012.log
.
My need is ,
My log file will need to support the max file size
Every log file has unique name with date.
Hope our stack users will help me.
There are several implementations available in public space, but actually it is much easier override RollingFileAppender
For example:
}
You can adjust it to you specific needs