cancel
Showing results for 
Search instead for 
Did you mean: 

Configure logfile location

decla
Champ in-the-making
Champ in-the-making
Hi,

Is it possible to change the location of alfresco.log (maybe to '/var/log/alfresco.log') without modifying log4j.properties in alfresco.war file?
I read something about a dev-log4j.properties file, which should be put under '$TOMCAT_HOME/shared/classes/alfresco/extension/'.
As we are using jboss i put the dev-log4j.properties under 'server/default/conf/alfresco/extension/', but the new config value seems not to take effect.

Environment: JBOSS 5.1.0GA, Alfresco 3.2 on RedHat

Sincerely,
decla
2 REPLIES 2

decla
Champ in-the-making
Champ in-the-making
I found out, that the content of '*-log4j.properties' in 'alfresco/extension/' must look like this:
log4j.rootLogger=error, File

log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=/var/log/alfresco/alfresco.log
log4j.appender.File.Append=true
log4j.appender.File.DatePattern='.'yyyy-MM-dd
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n

Its not enough to configure:
log4j.appender.File.File=/var/log/alfresco/alfresco.log

Now most of log output is stored in '/var/log/alfresco/alfresco.log', expect the following lines…
06:08:07,607 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from …
06:08:07,609 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from …
06:08:07,610 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from …
06:08:07,735 INFO  [org.alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from …
06:08:22,747 WARN  [org.springframework.jmx.support.JmxUtils] Found more than one MBeanServer instance. Returning first from list.
06:08:23,179 WARN  [org.springframework.jmx.support.JmxUtils] Found more than one MBeanServer instance. Returning first from list.
06:09:31,427 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework

Thanks,
decla

brazen
Champ in-the-making
Champ in-the-making
I found that out too.  I would prefer to just override the file location value and have it get the rest from whatever is in the war file.  Since it doesn't, I copy the whole file out of ../webapps/alfresco/WEB-INF/classes/log4j.properties and copy it to the ../alfresco/extension/custom-log4j.properties and then change the file location property in that file.

This is a pain in the neck.