You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Giovanni Mondo <gi...@yahoo.it> on 2013/12/30 17:57:03 UTC

log4j2 and ServletContextListeners

Hi,

I’m migrating a web application running on Tomcat from log4j to log4j2.
 
The web application has Filters, ServletContextListeners and Servlets .
 
Log is expected to be addressed by a Log4jServletContextListener whilst default log is addressed by a log4j2.xml in classpath.
 
Filters and Servlets are now logging in the expected log whilst ServletContextListeners are logging in default log.
 
Do you think this is the right behaviour or there could be an error in my configuration ?
 
Regards,
 
Giovanni

Re: log4j2 and ServletContextListeners

Posted by Giovanni Mondo <gi...@yahoo.it>.
Hi Remko, 

many thanks for your fast response. I did as you asked with https://issues.apache.org/jira/browse/LOG4J2-484 .

Best regards,

Giovanni



Il Mercoledì 1 Gennaio 2014 0:39, Remko Popma <re...@gmail.com> ha scritto:
 
Giovanni,
If I understand correctly, logging configuration is done partially programmatically and partially by config file. These have different target log files, and some of the output is showing up in a different target log file than expected. 

It's going to be difficult to say anything useful about this without more info. 
The mailing list software doesn't like attachments, so can I ask you to raise a ticket in the Jira issue tracker and attach your configuration and the code where you programmatically configure logging?

Thanks!
Remko

Sent from my iPhone


> On 2013/12/31, at 1:57, Giovanni Mondo <gi...@yahoo.it> wrote:
> 
> Hi,
> 
> I’m migrating a web application running on Tomcat from log4j to log4j2.
>  
> The web application has Filters, ServletContextListeners and Servlets .
>  
> Log is expected to be addressed by a Log4jServletContextListener whilst default log is addressed by a log4j2.xml in classpath.
>  
> Filters and Servlets are now logging in the expected log whilst ServletContextListeners are logging in default log.
>  
> Do you think this is the right behaviour or there could be an error in my configuration ?
>  
> Regards,
>  
> Giovanni

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

Re: log4j2 and ServletContextListeners

Posted by Remko Popma <re...@gmail.com>.
Giovanni,
If I understand correctly, logging configuration is done partially programmatically and partially by config file. These have different target log files, and some of the output is showing up in a different target log file than expected. 

It's going to be difficult to say anything useful about this without more info. 
The mailing list software doesn't like attachments, so can I ask you to raise a ticket in the Jira issue tracker and attach your configuration and the code where you programmatically configure logging?

Thanks!
Remko

Sent from my iPhone

> On 2013/12/31, at 1:57, Giovanni Mondo <gi...@yahoo.it> wrote:
> 
> Hi,
> 
> I’m migrating a web application running on Tomcat from log4j to log4j2.
>  
> The web application has Filters, ServletContextListeners and Servlets .
>  
> Log is expected to be addressed by a Log4jServletContextListener whilst default log is addressed by a log4j2.xml in classpath.
>  
> Filters and Servlets are now logging in the expected log whilst ServletContextListeners are logging in default log.
>  
> Do you think this is the right behaviour or there could be an error in my configuration ?
>  
> Regards,
>  
> Giovanni

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org