Application Logs cannot be stored in the home directory logs directory if the directory is setup as a symbolic link

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 7.17.0
    • Affects Version/s: 7.14.0, 7.14.1, 7.14.2, 7.15.0, 7.16.2
    • 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

      1. Ensure that you have at least Confluence 7.14.1 installed.
      2. Head over to <home-directory> and remove the <home-directory>/logs directory
      3. setup the logs directory as symbolic link to another location e.g:
        ln -s /path/to/different/location  /path/to/home/directory/logs
        
      1. 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. 

       

       

       

            Assignee:
            Kenny MacLeod
            Reporter:
            Ahmad Faridi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: