1

In a "classic" Java development, without maven, we use a third party library that uses SLF4J. In this way: (Model A)

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
...
private static final Logger log = LoggerFactory.getLogger(PLGSharepointClientOnline.class);
...
log.debug("some message...");

Our code uses Log4j v2. In "migrated mode" from Log4j v1 through the binding (log4j-1.2.api.jar). In this way (Model B):

import org.apache.log4j.Logger;
...
private static final Logger log = Logger.getLogger(PruebaPLG.class);
...
log.debug("some message...");

As we have read, in https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/, by using the log4j-slf4j-impl.jar adapter, the SLF4J traces would still work.

We use these libraries, but the traces from SLF4J (Model A) are lost.

log4j-1.2-api-2.17.1.jar
log4j-core-2.17.1.jar
log4j-api-2.17.1.jar

log4j-slf4j-impl-2.17.1.jar

slf4j-api-1.7.25.jar

commons-logging-1.2.jar
JLLMNCHR
  • 1,551
  • 5
  • 24
  • 50

0 Answers0