GitHub user ppkarwasz added a comment to the discussion: Help with migrating 
from log4j to log4j2 (we also use a slf4j -> log4j)

> And then setting debug to all, doesn't apply it to the log4j 1.x / slf4j 
> loggers. Any ideas @ppkarwasz ?

Sorry, I’m having a hard time following from the full class. Could you post 
just the minimal code snippet that reproduces the issue? That would make it 
much easier to help.

In general, if a **Log4j 1.x** or **SLF4J** logger behaves differently from a 
**Log4j API** logger, it usually indicates a **classpath problem**. Bridges 
between logging APIs are provided by specific artifacts; if the right bridge is 
missing, or if an old one is still present, those loggers won’t be routed to 
the Log4j API. The [Installation 
guide](https://logging.apache.org/log4j/2.x/manual/installation.html#concepts) 
has a full list of which APIs need bridging.

A common pitfall during migration is that leftover artifacts from Log4j 1.x 
remain on the classpath (directly or as transitive dependencies). These can 
silently short-circuit the bridging and prevent loggers from behaving 
consistently.

Since you’re building with Bazel and I am not familiar with it, could you share 
the Maven coordinates of any dependencies whose names include `log` or 
`reload4j`? That would help identify whether something is still pulling in 
Log4j 1.x or a conflicting bridge.


GitHub link: 
https://github.com/apache/logging-log4j2/discussions/3914#discussioncomment-14310752

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@logging.apache.org

Reply via email to