Another option would be to move the "restricted" log4j.properties file into something like src/test/log4j and then add a system property to surefire configuration to pick it up from there. When running with maven, it would be used. When running in your IDE, it wouldn't be picked up and the default log4j stuff.
Another option MIGHT be to change to using slf4j-jdk14 instead of log4j in combination with the above. By default, the jul stuff doesn't really pick up a config file so in the IDE, you get INFO level and stuff printed. By passing in the properties file via maven surefire config, maven can use a more restricted one. This is somewhat what CXF does. (although CXF uses jul natively, but does use slf4j-jdk14 for the stuff that needs it) I definitely agree that when running in the IDE, I would like to see the logs on the console. Dan On Monday, August 22, 2011 9:03:41 AM bvahdat wrote: > Hi, > > while running the camel's own test cases one can't see the logs directly in > his IDE as always the 'org.apache.log4j.FileAppender' is used/active in > log4j.properties under camel-xyz/src/test/resources/log4j.properties. So you > always have to switch from your IDE to the redirected outputs in > target/camel-xyz-test.log to see the logs. To me this was annoying but don't > know what others think about it. Other than that while changing/working on > the camel code & running the unit-tests the Camel Riders would prefer to > see the logs directly in their IDE, I assume! > > On the other hand, I think the reason for that was not to flood the maven > console while doing 'mvn test', 'mvn install', etc. right? > > IMHO I think one can change them to out instead of file, that's > > log4j.rootLogger='LOG_LEVEL', out > > But instruct sunfire-plugin in [1] (a pluginManagment entry in there) to > redirect the output to files through the option [2]. > > Would it make sense to you? At least that's the way I do it by my client's > projects. > > [1] https://svn.apache.org/repos/asf/camel/trunk/parent/pom.xml > [2] > http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#redirec > tTestOutputToFile > > Regards, Babak > > -- > View this message in context: > http://camel.465427.n5.nabble.com/log4j-properties-in-camel-tp4723887p47238 > 87.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Daniel Kulp dk...@apache.org http://dankulp.com/blog Talend - http://www.talend.com