logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giovanni Mondo (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4J2-484) log4j2 and ServletContextListeners
Date Thu, 09 Jan 2014 06:59:54 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13866370#comment-13866370
] 

Giovanni Mondo edited comment on LOG4J2-484 at 1/9/14 6:59 AM:
---------------------------------------------------------------

Yes, there was two different log4j2.xml, but only one in classpath, The other one (the one
to deploy in /tmp) was referenced  by Log4jServletContextListener in web.xml and could have
another name. I keep it outside the war because deploying in different environments the final
destination could change (/tmp is just to keep "simple" the example).

I attacched a slightly different maven project (MavenWeb2.zip) in which I changed the referenced
file name in web.xml . The deployment here requires only to write final_log4j2.xml in /tmp
.

The /tmp/default_MavenWeb.log let me sure that no log is lost, the /tmp/MavenWeb.log is the
required destination but is logged only by the servlet. No way to be logged also by HelloWorldServletContextListener
?




was (Author: giogeo):
Yes, there are two different log4j2.xml, but only one in classpath, The other one (the one
deployed in /tmp) is referenced  by Log4jServletContextListener in web.xml and could have
another name. I keep it outside the war because deploying in different environments the final
destination could change (/tmp is just to keep "simple" the example).

The /tmp/default_MavenWeb.log let me sure that no log is lost, the /tmp/MavenWeb.log is the
required destination but is written only by the servlet.

I attacched a slightly different maven project (MavenWeb2.zip) in which I changed the referenced
file name in web.xml . The deployment here requires only to write final_log4j2.xml in /tmp
.

> log4j2 and ServletContextListeners
> ----------------------------------
>
>                 Key: LOG4J2-484
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-484
>             Project: Log4j 2
>          Issue Type: Question
>          Components: Configurators
>    Affects Versions: 2.0-beta9
>         Environment: java 1.7.0_11-b21, tomcat-7.0.14
>            Reporter: Giovanni Mondo
>            Priority: Trivial
>              Labels: newbie
>             Fix For: 2.0-rc1
>
>         Attachments: MavenWeb2.zip
>
>
> Logging configuration is done by two config file:
> WEB-INF/classes/log4j2.xml  logging in /tmp/default_MavenWeb.log
> and
>  
> /tmp/log4j2.xml as log4jConfiguration of a Log4jServletContextListener logging in /tmp/MavenWeb.log
>  
> Is it possible to log HelloWorldServletContextListener in /tmp/MavenWeb.xml as HelloWorldServlet
does ? 
> A minimal maven project with full details can be found in attachment.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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


Mime
View raw message