Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-32875

Configure Tomcat logs with Log4j

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2023.x, 2025.x
    • Component/s: Configuration
    • Release Notes Summary:
      Tomcat Log configuration with Log4j
    • Release Notes Description:
      Hide

      The Tomcat logs configuration can be handled by Log4j which easily allows to configure Tomcat logs in Cloud environments.

      The introduced configuration routes all Tomcat logs to log/catalina.log (without the date) with same level as with the JUL configuration under conf/logging.properties.
      This mechanism will be the default for LTS 2025 and need to be opt-in in LTS 2023.
      You need to enable the tomcat-logs template for LTS 2023, for example by adding the following to your nuxeo.conf:

      nuxeo.append.templates.tomcat-logs=tomcat-logs
      

       

      Show
      The Tomcat logs configuration can be handled by Log4j which easily allows to configure Tomcat logs in Cloud environments. The introduced configuration routes all Tomcat logs to log/catalina.log (without the date) with same level as with the JUL configuration under conf/logging.properties . This mechanism will be the default for LTS 2025 and need to be opt-in in LTS 2023. You need to enable the tomcat-logs template for LTS 2023, for example by adding the following to your nuxeo.conf : nuxeo.append.templates.tomcat-logs=tomcat-logs  
    • Tags:
    • Upgrade notes:
      Hide

      If you enable the Tomcat logs with Log4j configuration feature in LTS 2023 you might need to migrate conf/logging.properties to log4j2.xml if you have one.
      The default conf/logging.properties was migrated to this portion of the default log4j2.xml file:

          <!-- Tomcat catalina loggers -->
          <Logger name="org.apache.catalina" level="warn" additivity="false">
            <AppenderRef ref="CATALINA" />
          </Logger>
          <Logger name="org.apache.catalina.core.AprLifecycleListener" level="info" />
          <Logger name="org.apache.catalina.core.ContainerBase" level="info" />
          <Logger name="org.apache.catalina.startup.Catalina" level="info">
            <AppenderRef ref="CONSOLE" />
          </Logger>
          <Logger name="org.apache.catalina.startup.VersionLoggerListener" level="info" />
          <!-- Tomcat coyote loggers -->
          <Logger name="org.apache.coyote" level="warn" additivity="false">
            <AppenderRef ref="CATALINA" />
          </Logger>
          <!-- Tomcat jasper loggers -->
          <Logger name="org.apache.jasper" level="warn" additivity="false">
            <AppenderRef ref="CATALINA" />
          </Logger>
      

      The JUL configuration present under conf/logging.properties will be removed in LTS 2025.
      The log files: classloader.log, stderr.log, and tomcat.log will also be removed in LTS 2025 as their logs are now written to catalina.log.

      Show
      If you enable the Tomcat logs with Log4j configuration feature in LTS 2023 you might need to migrate conf/logging.properties to log4j2.xml if you have one. The default conf/logging.properties was migrated to this portion of the default log4j2.xml file: <!-- Tomcat catalina loggers --> <Logger name= "org.apache.catalina" level= "warn" additivity= " false " > <AppenderRef ref= "CATALINA" /> </Logger> <Logger name= "org.apache.catalina.core.AprLifecycleListener" level= "info" /> <Logger name= "org.apache.catalina.core.ContainerBase" level= "info" /> <Logger name= "org.apache.catalina.startup.Catalina" level= "info" > <AppenderRef ref= "CONSOLE" /> </Logger> <Logger name= "org.apache.catalina.startup.VersionLoggerListener" level= "info" /> <!-- Tomcat coyote loggers --> <Logger name= "org.apache.coyote" level= "warn" additivity= " false " > <AppenderRef ref= "CATALINA" /> </Logger> <!-- Tomcat jasper loggers --> <Logger name= "org.apache.jasper" level= "warn" additivity= " false " > <AppenderRef ref= "CATALINA" /> </Logger> The JUL configuration present under conf/logging.properties  will be removed in LTS 2025. The log files: classloader.log , stderr.log , and tomcat.log will also be removed in LTS 2025 as their logs are now written to catalina.log .
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #121
    • Story Points:
      2

      Description

      Currently the Tomcat logs are configured within conf/logging.properties which differ from the Nuxeo server log configuration located to lib/log4j2.xml.

      We would like to be able to configure Tomcat logs with the current Log4j configuration.

      This will allows us to get rid of former JUL configuration (conf/logging.properties), but this will also allow to easier redirect Tomcat logs to the log collector in Cloud environments.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: