-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 7.14.0, 7.14.1, 7.14.2, 7.15.0, 7.16.2
-
Component/s: Server - Administration
-
None
-
2
-
Severity 3 - Minor
-
11
Issue Summary
Since at least Confluence 7.14.2, if <home-directory>/logs/ is setup as symbolic link the, application logs are not created and the following is seen in the catalina.out
2021-11-18 17:08:01,440 ERROR [Catalina-utility-1] [confluence.impl.logging.LogAppenderController] error Could not create logs directory /xxx/xxxxx/logs. Logging remains directed to the ConsoleAppender. java.nio.file.FileAlreadyExistsException:
System admins use this method to store the log files in a different location. By setting the <home-directory>/logs/ as symbolic link the log files are redirected to a different location.
Steps to Reproduce
- Ensure that you have at least Confluence 7.14.1 installed.
- Head over to <home-directory> and remove the <home-directory>/logs directory
- setup the logs directory as symbolic link to another location e.g:
ln -s /path/to/different/location /path/to/home/directory/logs
- start Confluence
Expected Results
Application logs are created and redirected to /path/to/different/location .
Actual Results
The log files are not created and the following is seen:
2021-11-18 17:08:01,440 ERROR [Catalina-utility-1] [confluence.impl.logging.LogAppenderController] error Could not create logs directory /xxx/xxxx/logs. Logging remains directed to the ConsoleAppender. java.nio.file.FileAlreadyExistsException:
Note:
This issue seems to only happen with the application logs. If we do the same steps above on the tomcat logs (installation directory logs), the issue is not seen.
Workaround
The workaround involves modifying the log4j.properties file manually as follows:
First you will need to comment:
#log4j.appender.confluencelog=com.atlassian.confluence.logging.ConfluenceHomeLogAppender
and then uncomment the following:
log4j.appender.confluencelog=org.apache.log4j.RollingFileAppender
log4j.appender.confluencelog.File=${catalina.home}/logs/atlassian-confluence.log
The above will place the atlassian-confluence.log in the location where the tomcat/catalina logs are stored. Similarly, you will need to repeat the above with the remaining logs. i.e. synchronylog, securitylog, indexlog,outgoingmaillog, sqllog. Please adjust the file names as well as the class name accordingly.