ctubbsii commented on PR #2155:
URL: https://github.com/apache/zookeeper/pull/2155#issuecomment-2050713619

   > Yes, it makes sense. I might steal your interpretation and add an optional 
runtime dependency on Logback to `log4j-to-slf4j`, although the proposal to 
make Log4j Core an optional runtime dependency of `log4j-slf4j2-impl` in 
[LOG4J2-3601](https://issues.apache.org/jira/browse/LOG4J2-3601) was not met 
with a big applause. 😜 [Disclaimer: I understand that these examples give the 
user only one serious choice of logging backend, while Zookeeper has two]
   
   LOG4J2-3601 was a problem because:
   
   1. it was an unexpected change in behavior from `log4j-slf4j-impl` to 
`log4j-slf4j2-impl` to be more "flexible" that nobody asked for and made things 
inconvenient, and
   2. the new use cases it supported were nonsensical (they added an extra 
layer of log4j that wasn't needed and adding it for those use cases would have 
been bad practice)
   
   I suspect adding logback as an optional runtime dependency to 
`log4j-to-slf4j` is probably not a great idea, but for different reasons. For 
starters, choosing logback seems arbitrary and a less good default than, say, 
`slf4j-simple`. slf4j has many runtimes that are all optional, and logback is 
only one of them. It's not really necessary to list all of them as optional 
runtimes, or any of them. The website does a better job documenting how to bind 
runtimes than the XML in a POM would. It's also a different situation than here 
with ZK, where logback is in a different position because ZK chose logback as 
its default (and what it ships with). But, ZK also needs to more easily support 
other runtimes when ZK is used like a library dependency. That's very different 
than `log4j-to-slf4j` or `slfj-api`, where there is no default runtime 
selected. In any case, that's a discussion for the log4j community. Feel free 
to tag me in any discussions of that, though, if you want me to provide a re
 view or an opinion there.


-- 
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]

Reply via email to