Simple tips about Alfresco logs

Basic maintenaince of your Alfresco logs

Today I put together some basic tips about Alfresco logs in Alfresco installations.

1. Rotate catalina.out

The Tomcat Server log file catalina.out grows and grows by default. You can use a custom for default Tomcat configuration, but you can easier use logrotate for catalina.out 

$ sudo vim /etc/logrotate.d/alfresco

/opt/alfresco/tomcat/logs/catalina.out {
  rotate 10
  size 50M

If logrotate is not used by the operating system you can define a cronjob with crontab -e for your Alfresco user (owner of java process) with:

#IMPORTANT: As Alfresco user
$ crontab -e 

0 5 * * 1 /usr/sbin/logrotate /etc/logrotate.d/alfresco


2. Logs always under $TOMCAT/logs directory

It is very usual to see Alfresco logs in different folders, between $ALF_HOME, and $ALF_HOME/tomcat/logs when installing with the Alfresco bundle. You can change your for alfresco.war, share.war, or solr4.war applications (and manager and host-manager too) but the next tip is easier for keeping together in the same place. This is valid for recent Alfresco 4 and 5:

 1. Change $ALF_DATA/ script adding the next line under INSTALLDIR variable:

cd $INSTALLDIR/tomcat/logs

 2. Comment in $ALF_DATA/tomcat/scripts/ the "cd" lines:


#cd $previousdir


3. Clean logs periodically

You can use a simple crontab script for deleting old rotated logs.

# Crontab for your Alfresco user (owner of java process)
# 0 5 * * 1 /opt/alfresco/bin/



find ${LOGS_TOM}/* -mtime +${LOGS_DAYS} -name \*.log\* -delete 2>/dev/null

4. Disable Tomcat localhost logs (localhost_access_log*)

Sometimes it is desired to disable localhost_access_log* logs. For this, you should comment the valve part in server.xml config

$ vim $ALF_HOME/tomcat/conf/server.xml

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

(and restart Alfresco Service)

5. Disable manager and host-manager logs

It is usual to disable manager and host-manager under webapps in production environment. For their preconfigured log files edit $ALF_HOME/tomcat/conf/ using only:

handlers =

and comment all related lines regarding:


External links and helping sources:

More Blog Entries

We are speaking at Beecon 2017

Next week we will participate in Alfresco Developer Conference (Beecon 2017), presenting two...

KMeans con Zeppelin y Spark

Siguiendo estos dos artículos de internet, uno donde se explica como crear un modelo...


Angel borroy 5 Months Ago

Alternative for point 2 in Alfresco 6 (Docker Compose) available at