Note that there are some explanatory texts on larger screens.

plurals
  1. POLog4j messages lost in Eclipse console when running in Ant
    text
    copied!<p>I've been trying to get logging with Apache log4j to appear correctly in Eclipse's console when running in Ant and am having no luck. I have a working log4j.xml configuration that has a basic root logger, with a debug priority and a ConsoleAppender. I have verified that the logger works because if I remove the log4j.xml from the project, the Ant target complains about it missing a log4j configuration. If I switch the appender to a file appender, all of the output properly goes to the file. Switching it back to the console, I get nothing to the Eclipse console except the standard Ant output.</p> <p>My JUnit tests, however, output log4j messages but I believe that is because I run them in batch and have those processes forked.</p> <p><strong>If I run the exact same Ant script on the command line with no changes, I get the log4j output I expect interlaced with the Ant output.</strong> I am running Ant 1.7.1 in Eclipse Helios on my Mac 10.6 Intel 64 machine. I have verified this is also an issue on a Windows XP machine running Helios. I have tried setting "follow" to true in my console appender configuration and this has not helped.</p> <p>I can provide code snippets, but like I've mentioned, I've proven that log4j is configured correctly and the log4j.xml is being picked up on the classpath and logging is being performed and outputted. It has something to do with how Ant integrates with Eclipse - anyone else experience this? Should this be something I submit to the Eclipse project?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload