logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: log4j2 web lookup questions
Date Fri, 10 Apr 2015 17:41:58 GMT
In both of these logs I am seeing the message 

2015-04-10 16:43:41,840 DEBUG Log4jServletContextListener ensuring that Log4j starts up properly.

after Log4j has initialized. Somehow your other components are initializing before Log4j.
It needs to be first for everything to work properly.

Ralph


> On Apr 10, 2015, at 9:49 AM, Ponder Muse <ponder.muse@googlemail.com> wrote:
> 
> Hi Remko,
> 
> Yes. If log4j-slf4j-impl is in the classpath, then the ${web:contextPath} lookup does
not work. If I remove log4j-slf4j-impl from the classpath, then the ${web:contextPath} lookup
works fine.
> 
> Find attached my deployment's log4j2.xml.
> 
> Also, I attach a console log which shows what goes on when log4j-slf4j-impl is not in
the classpath (i.e. when the ${web:contextPath} lookup works).
> 
> Maybe you can spot some crucial differences there...
> 
> Cheers,
> PM.
> 
> On 10 April 2015 at 17:28, Remko Popma <remko.popma@gmail.com <mailto:remko.popma@gmail.com>>
wrote:
> I can't see any problem in the attached log.
> Tell us again, why can't you use log4j-slf4j-impl? Are you saying that web
> lookups won't work if that jar is in the classpath?
> 
> On Sat, Apr 11, 2015 at 12:57 AM, Ponder Muse <ponder.muse@googlemail.com <mailto:ponder.muse@googlemail.com>>
> wrote:
> 
> > Hello Ralph,
> >
> > Thanks for your input.
> >
> > What am I looking for in the logs in order to see if log4j is being called
> > before it has had a chance to initialise?
> >
> > I include here an attachment of my deployment's console log. You might be
> > able to spot something that explains things.
> >
> > Also, in terms of our deployment, our Spring 4 code is all java based and
> > no longer xml based. I am not sure if that should matter though...
> >
> > Thanks again,
> > PM.
> >
> >
> >
> > On 10 April 2015 at 16:35, Ralph Goers <ralph.goers@dslextreme.com <mailto:ralph.goers@dslextreme.com>>
wrote:
> >
> >> Oh - and I should point out that I have several web apps running with
> >> Spring 4, log4j 2 and log4j-slf4j-impl without any problems.
> >>
> >> Ralph
> >>
> >> > On Apr 10, 2015, at 8:34 AM, Ralph Goers <ralph.goers@dslextreme.com
<mailto:ralph.goers@dslextreme.com>>
> >> wrote:
> >> >
> >> > What happens when log4j-slf4j-impl is present?  Is Log4j being called
> >> before it has had a chance to initialize?
> >> >
> >> > Ralph
> >> >
> >> >> On Apr 10, 2015, at 5:35 AM, Ponder Muse <ponder.muse@googlemail.com
<mailto:ponder.muse@googlemail.com>>
> >> wrote:
> >> >>
> >> >> Hello,
> >> >>
> >> >>
> >> >>
> >> >> We have Spring 4 based WAR deployments running on Tomcat 7.0.5x
> >> containers
> >> >> which have just had their log4j2.xml configurations updated to do a
> >> >> ${web:contextPath} lookup in order to use a deployment’s context
path
> >> as
> >> >> part of the rolling file’s filename.
> >> >>
> >> >>
> >> >>
> >> >> We have been able to get log4j2’s web lookups to work but, only after
> >> >> making two changes in our deployment’s configurations. I list these
> >> below:
> >> >>
> >> >>
> >> >>
> >> >> 1) We had to remove org.apache.logging.log4j:log4j-slf4j-impl:2.2 jar
> >> from
> >> >> the deployment’s classpath (but we don't know why this is necessary?
We
> >> >> need this facade for when using 3rd party jars that don't natively
work
> >> >> with log4j2, right!?).
> >> >>
> >> >>
> >> >> 2) We had to include a <display-name>name_here</display-name>
entry in
> >> the
> >> >> deployment's web.xml (I read in a Stackoverflow post that the display
> >> name
> >> >> should not be enforced and that it was a bug – not sure if it’s
a
> >> Tomcat
> >> >> bug or log4j2 bug however).
> >> >>
> >> >>
> >> >>
> >> >> Could somebody comment on points 1) and 2)? Particularly point 1) as
we
> >> >> really need to have log4j-slf4j capability in our deployments.
> >> >>
> >> >>
> >> >>
> >> >> Thanks for any comments/suggestions to these two points.
> >> >>
> >> >>
> >> >> PM.
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org <mailto:log4j-user-unsubscribe@logging.apache.org>
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org <mailto:log4j-user-help@logging.apache.org>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org <mailto:log4j-user-unsubscribe@logging.apache.org>
> > For additional commands, e-mail: log4j-user-help@logging.apache.org <mailto:log4j-user-help@logging.apache.org>
> >
> 
> <no-slf4j-impl-jar-in-classpath-eclipse-console.log><log4j2.xml>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message