logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ponder Muse <ponder.m...@googlemail.com>
Subject Re: log4j2 web lookup questions
Date Fri, 10 Apr 2015 16:49:02 GMT
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> 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>
> 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>
> 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>
> >> 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
> >
> >> 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
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
>

Mime
View raw message