gnodet commented on code in PR #12694:
URL: https://github.com/apache/maven/pull/12694#discussion_r4357324920
##########
impl/maven-logging/src/main/java/org/apache/maven/slf4j/MavenSimpleLogger.java:
##########
@@ -39,14 +39,90 @@ public class MavenSimpleLogger extends MavenBaseLogger {
private String warnRenderedLevel;
private String errorRenderedLevel;
Review Comment:
The fundamental issue is that Maven uses SLF4J as its logging facade —
plugins call SLF4J `Logger`, not JUL. The flow is:
- **SLF4J path** (plugins, Maven core): `SLF4J Logger` → `MavenBaseLogger` →
`LogSink.accept()` directly, no JUL round-trip. SLF4J MDC, marker, and supplier
laziness are preserved.
- **JUL path** (frameworks: Hibernate, Netty, etc.): JUL `Logger.log()` →
`MavenJulHandler` (our root handler) → convert to `LogEvent` → `LogSink`.
If we based everything on JUL `LogRecord`, we'd have to route SLF4J events
through JUL first — that's the `SLF4JBridgeHandler` direction, which goes the
wrong way. We'd pay a round-trip overhead and lose SLF4J marker/MDC metadata
that doesn't fit in `LogRecord`'s fixed-shape API.
That said, it's a valid architectural question worth its own discussion
thread — if you think there's a cleaner path to unifying around `LogRecord`,
I'm happy to explore it. But I'd prefer not to rearchitect during this PR since
the downstream chain (#13180, #12695) is already built on the current model.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]