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: lo4j2.xml in EAR
Date Sun, 02 Nov 2014 00:00:35 GMT
I am not aware that we have implemented any specific support for EARs. That said, I am not
sure we need to. I’ve also looked at the Log4j 1.x code and don’t see anything specific
to supporting META-INF or EARs.

Log4j will load log4j2.xml from the classpath, so you should be able to do something like
what is described at https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath
<https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath>. I believe you
can also place it in the /lib directory or whatever directory is defined in the library-directory
element of the deployment descriptor. See http://javahowto.blogspot.com/2006/10/use-library-directory-in-javaee-5-apps.html
<http://javahowto.blogspot.com/2006/10/use-library-directory-in-javaee-5-apps.html>.

What app server are you using? 

Ralph



> On Nov 1, 2014, at 10:56 AM, Paul Benedict <pbenedict@apache.org> wrote:
> 
> When I used log4j 1.x, I could put my log4j.xml in the <EarRoot>/META-INF
> folder and it was found. I did try this with log4j 2.0.2 and the
> configuration was not found.
> 
> I read this but it only talks about WARs. I don't have a WAR but an EAR
> with EJB modules.
> http://logging.apache.org/log4j/2.x/manual/webapp.html
> 
> So is this feature missing in 2.x? Or did I do something wrong?
> 
> Cheers,
> Paul


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