@Ralph: for tomcat you can use their SPI ( https://github.com/apache/meecrowave/blob/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/logging/tomcat/Log4j2Log.java). For tomee it is harder since tomee itself has an API (LogStream) but OWB and cxf uses JUL as API (as mentionned before) and several libs use slf4j-api first etc...The move to JUL was really about consistency, if we get it for log4j2 adding 3-4 integrations and prevent users to use log4j in the app then we loose most of the work :(. For log4j2 in a container we also need a hack to not loose logs at shutdown (ctrl+x): https://github.com/apache/tomee/blob/master/utils/log4j2-tomee/src/main/java/org/apache/tomee/log4j2/Log4j2ShutdownHooksExecutor.java. Seems JUL doesn't have this issue, not sure why (surely "internal" shutdown hooks ordering).
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2017-09-05 21:06 GMT+02:00 Ralph Goers <ralph.go...@dslextreme.com>: > Please point me at the doc for how TomEE would expect us to implement it. > The doc for Tomcat is at https://tomcat.apache.org/ > tomcat-8.5-doc/logging.html <https://tomcat.apache.org/ > tomcat-8.5-doc/logging.html>, which indicates that implementing a Handler > is the only option. If you have a better way please share. > > Ralph > > > On Sep 5, 2017, at 11:20 AM, Romain Manni-Bucau <rmannibu...@gmail.com> > wrote: > > > > @Ralph: not exactly, if you check tomee/meecowave/cxf, all have Logger > > implementations backed by something else. Integration is more or less > good > > depending the requirements but extending logger you get an implementation > > almost as fast as a native log4j. It keeps JUL as API which also allows a > > dependency free solution. Only constraint is to create the jul Logger > > through a framework factory if you don't want to depend on the LogManager > > which is sadly set only on the JVM. The integration (Log4j2Logger) could > be > > owned by log4j2 (i assume it is in jul integration maybe?). It is better > > than a handler since it bypasses jul completely when switching and goes > on > > the impl directly. Summary is "jul is bad" doesnt mean dont use jul since > > you can make it good and stay dependency free for frameworks which is > quite > > important for not final dependencies (= you dont know if the app is used > in > > a final app or as a library in a stack). > > > > > > Romain Manni-Bucau > > @rmannibucau <https://twitter.com/rmannibucau> | Blog > > <https://blog-rmannibucau.rhcloud.com> | Old Blog > > <http://rmannibucau.wordpress.com> | Github <https://github.com/ > rmannibucau> | > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory > > <https://javaeefactory-rmannibucau.rhcloud.com> > > > > 2017-09-05 20:13 GMT+02:00 Gary Gregory <garydgreg...@gmail.com>: > > > >> On Tue, Sep 5, 2017 at 11:03 AM, Ralph Goers < > ralph.go...@dslextreme.com> > >> wrote: > >> > >>> > >>>> On Sep 5, 2017, at 9:19 AM, Romain Manni-Bucau <rmannibu...@gmail.com > > > >>> wrote: > >>>> > >>>> Le 5 sept. 2017 17:35, "Ralph Goers" <ralph.go...@dslextreme.com > >>> <mailto:ralph.go...@dslextreme.com>> a écrit : > >>>> > >>>> > >>>>> On Sep 5, 2017, at 6:45 AM, Romain Manni-Bucau < > rmannibu...@gmail.com > >>> > >>>> wrote: > >>>>> > >>>>>> > >>>>> > >>>>> I think it must go the other way: log4j2 must push projects to move > >>>>> otherwise projects will be happy with X -> log4j2 bridges, no? > >>>> > >>>> We already have support for bridging other APIs to Log4j 2. > >>>> > >>>> > >>>> Not bypassing jul impl without a logmanager right? That is what does > >>>> frameworks api > >>> > >>> Is what you are asking for the same as what is asked for in > >>> https://issues.apache.org/jira/browse/LOG4J2-2025? < > >>> https://issues.apache.org/jira/browse/LOG4J2-2025?> If so, I am > planning > >>> on doing that although that integration will not make users very happy. > >>> This is one of the reasons that jul sucks. > >>> > >> > >> Ralph, > >> > >> Do you want to assign that issue to yourself? That would allow others to > >> focus on different tickets. > >> > >> Gary > >> > >> > >>> > >>> Ralph > >> > >