开发者

Ant logger level ignored in Eclipse ONLY when "Run in the same JRE as the workspace"

This is my first post here so wish me luck.

I'm having a problem where my Log4J logger levels do not get written to the console when running my Ant build file from within Eclipse.

I am only seeing "info" and开发者_如何学Go higher even though I have specified "debug" in the log4j.properties. I know it is finding my log4j.properties because Ant complains when I temporarily delete the log4j.properties and run the Ant build.

By contrast, I am able to see the correct logging (debug vs info) when I run the Ant build from the command line. I can even get it to display in Eclipse if I edit the ant file configuration and choose "Separate JRE". However, I would prefer to "Run in the same JRE as the workspace" (unless anyone argues against it).

I'll gladly respond with any additional requested details if requested. For now, I'll add some details about my environment:

Windows XP

Eclipse Java EE IDE for Web Developers Helios SR 2 (v. 3.6.2)

Ant v1.8.2

Java JDK 1.6.0_24

As noted, I can get the debug logging levels to display in Eclipse if i choose "Separate JRE" which is the exact same 1.6.0_24 only now not running within Eclipse.


To run an ant script inside eclipse with specific commandline parameters, f.e. your log4j listener =

  • focus on your ant script in workspace
  • context menu use '2 Run as Ant Build'
  • in the Edit Configuration dialog choose 'Main' tab
  • set your command line parameters in 'Arguments' textfield =

-logger org.apache.tools.ant.listener.Log4jListener etc. ..

also see Ant Manual Listeners and Loggers

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜