JBoss 5.0.1: log4j.properties file not taking effect in EAR?

Wow! Talk about chasing your tail! First of all, bottom line, a Log4J running in JBoss 5.

X does see and process a log4j. Properties file in the root of an EAR. ... but only if there is nothing else to interfere with it.

For instance, if you were to package a log4j. Xml in the root of your EAR along with the log4j. Properties, Log4J defaults to the .

Xml file over the . Properties file. It loads the configuration from log4j.

Xml and doesn't even bother to look for a log4j.properties. Alas, that particular scenario was not my problem. When it was all said and done, my problem was a 3rd-party JAR that contained its own log4j.

Properties file. As with the . Xml file, if Log4J stumbles across one log4j.

Properties, it does not bother to look for another one. Well, for whatever reason, in JBoss 4.2. X, Log4J took the log4j. Properties in the root of the EAR over the one in the JAR.

In contrast, in JBoss 5. X, Log4J took the log4j. Properties file in the JAR rather than the one in the root of the EAR.

I have expunged the log4j. Properties file from the 3rd-party JAR, and everything works like a charm. I stumbled onto the cause of the problem by enabling Log4J's debug mode.

FYI, you can do this by starting JBoss with the switch -Dlog4j. Debug or by setting debug="false" in the log4j:configuration tag in jboss-log4j.xml.

AFAIK is the root folder of the ear not added to the classpath and is the properties file as such invisible. A better place would be in the root of a common jar file or in a WEB-INF/classes of the main war file.

I have a jndi. Properties in the EAR's root, and it is being processed. That's what has me so confused.

Why is one properties file being processed and the other one ignored? – Brad Coillins Aug 18 '10 at 17:22 I am sorry : I am now as confused as you... FWIW I have also spent many an hour trying to figure out which config file log4j was using... good luck at your quest! – Peter Tillemans Aug 18 '10 at 18:10 No sweat.

Thanks for sharing. – Brad Coillins Aug 19 '10 at 20:06.

I believe that to configure log4j in Jboss 5 you would edit the file at server/default/conf/jboss-log4j. Xml, for example, not a . Properties file..

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions