Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-79959

The default Java 11 Garbage Collection Logging Settings has the wrong syntax for filecount and filesize

    XMLWordPrintable

Details

    Description

      Issue Summary

      The default Java 11 Garbage Collection Logging Settings has the wrong syntax for filecount and filesize.

      Steps to Reproduce

      1. Install Confluence and pay attention to the files below that has the Java 11 Garbage Collection Logging Settings:
        • setenv.sh
          CATALINA_OPTS="-Xlog:gc+age=debug:file=$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log::filecount=5,filesize=2M ${CATALINA_OPTS}"
          
        • setenv.bat
          set CATALINA_OPTS=-Xlog:gc+age=debug:file="%atlassian_logsdir%\gc-%atlassian_timestamp%.log"::filecount=5,filesize=2M %CATALINA_OPTS%
          
        • service.bat
          -Xlog:gc+age=debug:file=\"%CATALINA_HOME%\logs\gc-%%t.log\"::filecount=5,filesize=2M
          
      2. Start Confluence with the respective methods above after modifying the filecount or filesize value(s)

      Expected Results

      The number of files and maximum size of each file should respect the new value that was modified.

      Actual Results

      The number of files and maximum size of each file is not respecting the new value that was modified.

      Workaround

      This is because there's a syntax error in the setting. Removing a colon(:) in the line by modifying them as below will resolve the issue:

        • setenv.sh
          CATALINA_OPTS="-Xlog:gc+age=debug:file=$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log:filecount=5,filesize=2M ${CATALINA_OPTS}"
          
        • setenv.bat
          set CATALINA_OPTS=-Xlog:gc+age=debug:file="%atlassian_logsdir%\gc-%atlassian_timestamp%.log":filecount=5,filesize=2M %CATALINA_OPTS%
          
        • service.bat
          -Xlog:gc+age=debug:file=\"%CATALINA_HOME%\logs\gc-%%t.log\":filecount=5,filesize=2M
          

          The examples here only focuses on getting the filecount and filesize to work

      Information

      Please note that if you're modifying this value while using Java 11, please refer to the related issue CONFSERVER-61415 to comment out the Java 8 GC Logging line

      Post Confluence 8.0

      Confluence 8.0 stopped supporting Java 8, which means the -Xloggc should be removed.

      When there is only -Xlog left in the configuration, both Java 11 and Java 17 should pick up the GC Logging setting above, and here's the recommended flag:

        • setenv.sh
          CATALINA_OPTS="-Xlog:gc*:file=$LOGBASEABS/logs/gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M ${CATALINA_OPTS}"
          
        • setenv.bat
          set CATALINA_OPTS=-Xlog:gc*:file="%atlassian_logsdir%\gc-%atlassian_timestamp%.log":tags,time,uptime,level:filecount=5,filesize=2M %CATALINA_OPTS%
          
        • In Windows Service:
          verify the installation directory is correct before applying
          -Xlog:gc*:file="C:\Program Files\Atlassian\Confluence\logs\gc-%t.log":tags,time,uptime,level:filecount=5,filesize=2M
          

      Attachments

        Issue Links

          Activity

            People

              ablekhman@atlassian.com Alex Blekhman
              btan@atlassian.com Damien Tan
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: