I don't build log4j configuration into my production applications. I include it as part of the server configuration. I've found that doing it any other way frequently leads to classloader wars because many application/web servers have their own copy of log4j anyway.

Your test results are non-deterministic because they are dependent upon an environment variable. The results may change depending upon the value of that variable.

As for your log statements not appearing, how are you declaring your Loggers in the code?

Also, try to get  a simple log4j configuration working first.

Steve C.

On 07/06/2006, at 11:29 PM, Toni Price wrote:


The thing is though, it doesn't seem to be a problem with log4j *finding* the
configuration file. That seems ok.

When you say you usually just put your log4j config file in
src/test/resources, I assume you mean you use a default name (like
log4j.properties) and then put another log4j.properties in
src/main/resources for your production environment? If that's the case then I'm not sure why that would be any more deterministic than having two log4j
properties files that are simply named differently for testing and
production (and the correct file name is chosen according to the
environment). I mean, somehow or another you need to have different
configurations for testing and production, right? I'm inclined to think that naming the files differently is even possibly clearer, since then it should be obvious from the file name which configuration is being used. Or have I
misunderstood? (Entirely possible!)

In any event, I've tried removing the systemProperties settings and putting a log4j.properties in src/test/resources as you've suggested, but exactly
the same thing happens: log4j appears to be configured, but there's no
logging output other than statements from log4j itself. I'm probably missing something obvious here, otherwise I'm sure lots more people would be having
this problem ... just wish I could see what it was :)


--
View this message in context: http://www.nabble.com/-M2--log4j- output-does-not-display-when-running-surefire-plugin- t1747117.html#a4751277
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to