alfresco.log error - FileNotFoundException

cancel
Showing results for 
Search instead for 
Did you mean: 
Member II

alfresco.log error - FileNotFoundException

Hello,

We are using Alfresco Content Services 5.2.5 (installation using the .zip).
When starting Alfresco, the following error is shown in the logs:

java.io.FileNotFoundException: alfresco.log (Permission denied)


I have tried to make sure all log4j settings are coherent.
We want to write logs to the /var/log/alfresco folder.
l
og4j.appender.File.File=/var/log/alfresco/alfresco.log has been set to both:
a) webapps/alfresco/WEB-INF/classes/log4j.properties
b) /opt/tomcat7/shared/classes/alfresco/extension/custom-log4j.properties

1) How can we fix this error?
2) Is it relevant? Logs seem to be written to /var/log/alfresco/alfresco.log.

Regards,
Liviu

2 Replies
Senior Member II

Re: alfresco.log error - FileNotFoundException

It seems , you have linux system and the user using which ou are starting the server does not have access to read or write in log files.Starting server using sudo/admin might resolve your issue.Other way will be to give read write permission to normal user using which you are starting the alfresco.

Member II

Re: alfresco.log error - FileNotFoundException

Krutik Jayswal‌ Thanks, but my permissions are fine (permissions are set to the tomcat7 user, as they should be).

I belive the issue is related to the following discussions:

https://issues.alfresco.com/jira/browse/MNT-18557
https://issues.alfresco.com/jira/browse/MNT-14859
https://issues.alfresco.com/jira/browse/REPO-4278
https://issues.alfresco.com/jira/browse/REPO-4512

Quote from REPO-4512:

The current alfresco.log configuration is stored inside the war file, see.
The configuration creates the alfresco.log in the base directory, which is often Tomcat root. This contradicts with security best practices around file permissions which require Tomcat root to be read only. Note that overrides in the custom-log4j.properties does not solve this issue.
One has to modify the internals of the war file (log4j.properties) and specify the correct path to the logs folder to mitigate this issue.It is bad practice to modify the internals of the war file.

but I am unable to understand the conclusion or to find a fix.