cancel
Showing results for 
Search instead for 
Did you mean: 

Logging locations galore...

eswbitto
Confirmed Champ
Confirmed Champ
I have edited the file /tomcat/shared/classes/alfresco/extension/custom-log4j.properties to have all the log files that are generated to be placed in /var/log/alfresco/then the file name.log

I'm getting two locations of where my files are being generated when I restart alfresco. From other posts on the forums its discouraged from editing the source files that actually place the log files to where they should go. Which alfresco employee's have said would be in the dir.root. Which they don't actually log there. (They are placed in my root), but NOT in the dir.root of the install.

That being said…What I really want is some granularity in file location for logging. I plan on implementing the logging into our syslog system and keeping it in /var/log/location keeps things nice and neat. Any ideas as to why I am getting two locations for logging?
2 REPLIES 2

bopolissimus
Confirmed Champ
Confirmed Champ
It's because when alfresco first starts up, it starts some logging before it even reads custom-log4j.properties.  So those go where tomcat thinks is the current working directory.  once tomcat has loaded up custom-log4j.properties and read/applied the location from there, it starts logging to that new location.

Not much you can do about it unless you're willing to unpack your war file, edit the location in log4j.properties and repack the war file.  or build from source, I guess.  I don't worry about the initial log entries myself.

When I'm running from the bundle, I usually just edit alfresco.sh.  where it says:

INSTALLDIR=/opt/alfresco-[version]

I add a line under it:

cd ${INSTALLDIR}/tomcat/logs

that way, the initial logs will go there. I have custom-log4j.properties also send the logs to the same directory.

That also helps with solr.log and share.log (which you can't redirect with entries in tomcat/shared/classes/alfresco/…

eswbitto
Confirmed Champ
Confirmed Champ
Thanks for the tidbit bopolissimus…I'll put that in my notes for if I ever have to do a fresh install. Marking this as solved.