My stdout single log file is growing over 5gb every week. It's too big and can't be opened with normal text editor like notepad++. Is there any way to:
- Limit file size around 100mb. If it reaches 100mb, then create a new file
- Limit the number of log files around 5. If the 6th stdout is created, then the oldest file will be deleted automatically.
In log4j.properties, I have the following:
#------------------- CONSOLE --------------------------
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.threshold=INFO
log4j.appender.CONSOLE.target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p [%t] %c{1} %m %n
I know we can do it with "RollingFileAppender", set MaxFileSize=100mb and set MaxBackupIndex=5. But for "ConsoleAppender", is there anyway to achieve the same?