> From: "Sreekanth S. Nair" <sreekanth.n...@egovernments.org>
> To: Struts Users Mailing List <user@struts.apache.org>, 
> Date: 19.07.2016 10:55
> Subject: Re: [ANN] Apache Struts 2.3.30 GA
> 
> Hi Christoph,
>                        Thanks for your detailed explanation, even though
> its a huge change for application to move from both slf4j and log4j1 to
> Log4j2, lets assume we moved all to Log4j2 but if the underlying
> application server eg: Jboss or wildfly have its own wrapper 
implementation
> for their logging with log4j1, which will print application generated 
log
> using stdout (This is what we have noticed after struts2 upgrade). Lets
> assume we turned off logging subsystem from Jboss and used Log4js
>  log4j2.xml which gives less flexibility (changing threshold on the fly)
> wrt logging in different environment when we compare to jboss one.
> 
> These all are our concern, we really doubt upgrading struts2, if log is
> directing to stdout. Please let us know if anyone have any thought
> regarding this or anyone successfully upgraded without stdout logging in
> Wildfly or Jboss 6.
> 
> 

First of all you can try to include configuration for both log4j versions 
in your app. logj42 config for the app itself and log4j1 config for the 
app server.


If this does not give you desired results you could still use log4j1 as 
log-implementation for the app and forward both APIs (log4j2-api and 
slf4j-api) to log4j1. To achieve that you would need log4j-slf4j-impl.

Your logging pipeline would look like this then:

log4j-api (v2) --> log4j-slf4j-impl --> slf4j-api --> slf4j-log4j12 --> 
log4j (v1)



Keep in mind that log4j1 has been deprecated. It is likely that old app 
servers contain other outdated libraries as well which might cause e.g. 
security issues. You should consider upgrading your app server. But of 
course that can take some time.



Regards,
Christoph



> 
> On Tue, Jul 19, 2016 at 2:00 PM, Christoph Nenning <
> christoph.nenn...@lex-com.net> wrote:
> 
> > > 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
> >


This Email was scanned by Sophos Anti Virus

Reply via email to