GitHub user ppkarwasz added a comment to the discussion: Should CoreLogger 
override `addHandler`/`removeHandler` to avoid warnings from PR #3125?

Hi @mpritham,

Those methods are not overridden because the JUL-to-Log4j bridge doesn’t 
provide a way to wrap JUL `Handler`s into Log4j Core `Appender`s.

You’re free to implement this as an extension of `log4j-jul`, but we would need 
to discuss whether it should be included in the main distribution.

This design is intentional:

1. **Native components are preferred**: Wrapping external components can 
introduce performance overhead and semantic differences.
2. **Reliability**: Log4j Core is designed to avoid losing log events (e.g., 
during reconfiguration). Supporting arbitrary wrapped components would make 
this harder and shift responsibility to the user to update components in the 
correct order (first add the new appender and only then remove the old one)

See: [Modifying configuration 
components](https://logging.apache.org/log4j/2.x/manual/customconfig.html#Hybrid)


GitHub link: 
https://github.com/apache/logging-log4j2/discussions/4066#discussioncomment-16189519

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to