> I'm not sure about bridging log4j1 to log4j2 gives us any benefit from
> enduser point of view, and most the people were using slf4j and log4j 1 
for
> sure, with the addition of log4j2 the chain is getting complex for a 
simple
> logging. 
> 
> 


In our apps we have been using slf4j and log4j1 for some time. As log4j1 
has been deprecated and struts 2.5 moved to log4j2-api we switched our 
logging impl to slf4j2 and created appropriate xml config files. To also 
grab log messages via slf4j we added log4j-slf4j-impl.

See:
https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/


That means our logging pipeline looks like this:



slf4j-api ----> log4j-slf4j-impl -\
                                  |--> log4j-core (v2)
log4j-api (v2) -------------------/



> Why can't struts2 can make a log wrapper around it based on the
> available logging lib?


That has been discussed on -dev mailing list. Reasons that I remember:
- log4j2 is backed by the ASF
- log4j2 can do everything slf4j can do
- There are all kinds of bridging libraries to connect with other logging 
APIs and implementations



Regards,
Christoph




> On Mon, Jul 18, 2016 at 9:14 PM, Adam Brin <ab...@digitalantiquity.org>
> wrote:
> 
> > Hi Emi,
> >   You’ll definitely need a log4j2.xml, and you may need to change the
> > listeners and also omit some other log4j 1.0 libraries from your pom. 
We
> > did the upgrade last year and found the docs on the log4j2 website 
useful,
> > you might start there.
> >
> > best of luck.
> >
> > --
> > _________________________________________________________
> > Adam Brin
> > Director of Technology, Digital Antiquity
> > 480.965.1278
> >
> > > On Jul 18, 2016, at 8:37 AM, Emi <em...@encs.concordia.ca> wrote:
> > >
> > >> try the bridge to log4j1
> > >> https://logging.apache.org/log4j/log4j-2.2/log4j-1.2-api/index.html
> > >>
> > >
> > > Updated to:
> > > . log4j-api-2.6.2.jar
> > > . log4j-core-2.6.2.jar
> > > . log4j-web-2.6.2.jar
> > > . log4j-1.2-api-2.6.2.jar
> > > . commons-logging-1.2.jar
> > > . struts2.5.2. jars
> > >
> > > Didn't change web.xml and log4j.xml.
> > >
> > > But log files were NOT auto-generated by tomcat7.0.70.
> > >
> > > Is there something that I missed to add/config?
> > >
> > > Thanks a lot!
> > > --
> > > web.xml
> > > ...
> > > <listener>
> > >
> > <listener-class>org.springframework.web.util.Log4jConfigListener</
> listener-class>
> > > </listener>
> > > ...
> > > <context-param>
> > >      <param-name>log4jExposeWebAppRoot</param-name>
> > >      <param-value>false</param-value>
> > >   </context-param>
> > >
> > >   <context-param>
> > >      <param-name>log4jConfigLocation</param-name>
> > > <param-value>/WEB-INF/classes/log4j.xml</param-value>
> > >   </context-param>
> > > ...
> > >
> > >
> > >
> > > 
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail: user-h...@struts.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >


This Email was scanned by Sophos Anti Virus

Reply via email to