cancel
Showing results for 
Search instead for 
Did you mean: 

limit the size of log files

midoscofield
Champ in-the-making
Champ in-the-making
Hello,

I wanted to limit the size of log files,because it eats up too much disk space.
And is it correct that insturction ?
"param name="MaxFileSize" value="1024KB"

Thanks
1 REPLY 1

abarisone
Star Contributor
Star Contributor
Hi,
since Alfresco uses log4j for logging, you have some choices.
This solution gives you the opportunity to limit the file size and to decide the number of backup files.
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1


Personally I prefer the DailyRollingFileAppender that rolls each day on a new file
# LOG4J daily rolling log files configuration
log4j.rootLogger=DEBUG, RollingAppender
log4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RollingAppender.File=app.log
log4j.appender.RollingAppender.DatePattern='.'yyyy-MM-dd
log4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.RollingAppender.layout.ConversionPattern=[%p] %d %c %M - %m%n


You can chack log4j page for more info at http://logging.apache.org/

Regards,
Andrea