How to better configure log rotation in Alfresco?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2013 04:51 PM
I have a big problem with files generated in alfresco (alfresco.log, share.log and solr.log) and tomcat (tomcat/logs/*). They seem to grow and rotate indefinitely and I don't know where rotation parameters are configured. I wish to use system's logrotate (example: /etc/logrotate.d/alfresco) but I think it will conflict with the existing default rotation of those files.
How can I configure log rotation defining max number of files and compression?
How can I configure log rotation defining max number of files and compression?
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2013 05:47 AM
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.
Personally I prefer the DailyRollingFileAppender that rolls each day on a new file
You can chack log4j page for more info at http://logging.apache.org/
If you need to modify Tomcat's log you need to refer to Tomcat Juli, which performs all logging operations.
Regards,
Andrea
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 filelog4j.appender.R.MaxBackupIndex=1
Personally I prefer the DailyRollingFileAppender that rolls each day on a new file
# LOG4J daily rolling log files configurationlog4j.rootLogger=DEBUG, RollingAppenderlog4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.RollingAppender.File=app.log log4j.appender.RollingAppender.DatePattern='.'yyyy-MM-ddlog4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayoutlog4j.appender.RollingAppender.layout.ConversionPattern=[%p] %d %c %M - %m%n
You can chack log4j page for more info at http://logging.apache.org/
If you need to modify Tomcat's log you need to refer to Tomcat Juli, which performs all logging operations.
Regards,
Andrea
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 03:10 PM
Thanks for the information, but which of the 4 log4j.properties files is the most important one to update?
I've updated:
./tomcat/webapps/share/WEB-INF/classes/log4j.properties
./tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
./solr4/log4j-solr.properties
With:
log4j.appender.File.MaxFileSize=1000KB
log4j.appender.File.MaxBackupIndex=5
Is that sufficient to stop the infinitely growing log files I have?
I've updated:
./tomcat/webapps/share/WEB-INF/classes/log4j.properties
./tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
./solr4/log4j-solr.properties
With:
log4j.appender.File.MaxFileSize=1000KB
log4j.appender.File.MaxBackupIndex=5
Is that sufficient to stop the infinitely growing log files I have?
