Bug ID: 63293
           Summary: Tomcat 9.0 logging not working with log4j1.2 after
                    upgraded from Tomcat 8.0
           Product: Tomcat 9
           Version: 9.0.13
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
  Target Milestone: -----

Created attachment 36500
This archive contains log4j configuration and sample Tomcat server.log files.

Tomcat 9.0 logging not working with log4j1.2 after upgraded from Tomcat 8.0

[Frequency of Occurrence]

[System/Software Info]
OS: Red Hat Enterprise Linux Server release 7.6 (Maipo)
Tomcat: 8.0.52 and 9.0.13
Tomcat Native: 1.2.17
Tomcat APR: 1.6.3
OpenSSL: 1.0.2o
OpenJDK (JRE): 1.8.0-171-b11

1. log4j 1.2.15 is used as the logging library with Tomcat.

2. A custom log4j configuration is used (see the attached "").
(1) log4j rootLogger is set to INFO, FILE
(2) The FILE appender is set to ${catalina.base}/logs/server.log

3. The same environment is used to run Tomcat.  The only difference before and
after the Tomcat upgrade is Tomcat itself.
(Note there exists change in FormAuthenticator and the use of
LegacyCookieProcessor as the CookieProcessor for backward compatibility.)

4. When running with Tomcat 8.0.52, some INFO logs from Tomcat
(org.apache.catalina.*) appear in ${catalina.base}/logs/server.log"

5. When running with Tomcat 9.0.13, the file ${catalina.base}/logs/server.log
is basically empty.

6. Refer to the attached sample server.log files from 8.0.52 and 9.0.13.

7. I checked the source code "" in
Tomcat 9.0.13. One logging statement in the code looks the same to me. 
However, I see this log with 8.0.52 but not 9.0.13.

8. This issue is observed in 9.0.13 (and higher).

// --- code Snippet [S] ---
... ...
    protected void startInternal() throws LifecycleException {

// <--- This log appears with 8.0.52

        // Start our defined Container first
        if (engine != null) {
            synchronized (engine) {
... ...
// --- code Snippet [E] ---

8. I looked up in the release notes and migration info but seem not seeing
Tomcat 9 would not work with log4j1.2.

9. The issue is also observed in Windows platform.

1. Tomcat 8.0.52 and 9.0.13
2. OpenSSL library. See the References section.
3. APR library for Linux. See the References section.
4. Tomcat Native library for Linux (this needs to be built from the source
code.  Tomcat does not include this for Linux.) See the References section.
5. Tomcat needs to be set up using APR/OpenSSL with proper certificate(s).

[Setup Steps]
1. Ensure the following files exist under ${catalina.base}\lib
(1) log4j.jar (v. 1.2.15)

[Procedure To Reproduce]
1. Start Tomcat 8.0.52 and check the file ${catalina.base}/logs/server.log
2. Start Tomcat 9.0.13 and check the file ${catalina.base}/logs/server.log

1. Tomcat
(1) Main:
(2) 8.0.52 download:
(3) 9.0.13 download:

2. log4j1.2
(1) Main:
(2) 1.2.15: Download:

3. Tomcat APR:
(1) Main:
(2) 1.6.3 download:

4. Tomcat Native
(1) Main:
(2) 1.2.17 download:

5. OpenSSL
(1) Main:
(2) 1.0.2o:

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to