'Log4j 1.x bridge not printing out logs properly in the log files
I am migrating my existing log4j 1.x to log 4j 2.17.1 and tried to use the log4j-1.2-api-2.17.1.jar so that I don't have to migrate any of my code. But when I use this method the logs don't get properly appended to the log files and the other logs that I have that is the business or technical logs they don't get written at all.
For example in the technical log the last line is only up to this:
2022-01-12T17:13:45,635 29901880 [pool-21-thread-2] INFO <[]> tech.com.test.BaseResponseHandler - Response Code: [200] Response ContentType: [Content-Type: application/json]
2022-01-12T17:13:45,
Is there anything I am doing wrong out here?
The pom file:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>2.17.1</version>
</dependency>
Please note that I am using a custom Logging mechanism and was loading the property file by PropertyConfigurator but now loading it via this way:
//the url is the path of the custom log4j prop files
System.setProperty("log4j.configuration", url.getPath());
Deployment of the application is done on weblogic 12g and written in Java.
what needs to be done as the functionality is not working as expected?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
