-
1. Re: JBoss OSGi logging policy
adrian.brock Nov 11, 2009 10:26 AM (in response to thomas.diesler)We really need to sort this out. The current log4j config is unusable for me.
I can't run tests from inside eclipse without modifying it and I'm going to
forget to revert it from time to time on commits.
This coupled with all the refactoring and other braindeaths is making this project
a real problem to work on. -
2. Re: JBoss OSGi logging policy
thomas.diesler Nov 16, 2009 9:03 PM (in response to thomas.diesler)
I can't run tests from inside eclipse without modifying it and I'm going to
forget to revert it from time to time on commits.
In every projects pom there is a comment that tells you what properties to set in the eclipse test configurations to achieve the same runtime behaviour as from the command line.
For the Framework that would be-Dlog4j.output.dir=${workspace_loc:jboss-osgi-framework/target} -Dorg.jboss.osgi.framework.launch.bootstrapPath=bootstrap/jboss-osgi-bootstrap.xml
This is needed because the system properties that are defined on the surefire plugin are unfortunately not used by the eclipse test runs, which is a general problem that applies to all system properties that should be available at test runtime.
I've seen test cases that duplicate the settings from the pom and hard code them into the test. This IMHO is not so good. Instead system properties should go into the eclipse test configuration.
I also run tests from eclipse on a daily basis, once the props are set in eclipse its should be all good. -
3. Re: JBoss OSGi logging policy
adrian.brock Nov 18, 2009 11:39 AM (in response to thomas.diesler)There is more to it than just setting system properties,
and I don't start eclipse from the command line anyway.
I also want to be able run tests and see the logging in the console.
It's inefficient in my opinion to have to shell out to a file to inspect the logging.
e.g. can't click on a stacktrace and go straight to the line of code that caused the problem.
As I've said, it should be Hudson or Maven that redirects logging to a file
using the log4j.configuration system property.
It shouldn't automatically go there using hardwired rules embedded in the change log
that are not suitable for everybody's working practices. -
4. Re: JBoss OSGi logging policy
thomas.diesler Nov 20, 2009 4:29 AM (in response to thomas.diesler)
As I've said, it should be Hudson or Maven that redirects logging to a file using the log4j.configuration system property.
yes, I've tried that by setting the surefire system properties. It worked for some test cases but not all. I didn't look into the log4j initialization to find out why it did not work for all cases.
In another attempt to make you happy, I now added log4j-console.xml to the test resources.
Please put the log4j.configuration property in your test setup like shown below. This should produce eclipse console logging.
http://drop.io/sfodign -
5. Re: JBoss OSGi logging policy
thomas.diesler Dec 16, 2009 7:46 AM (in response to thomas.diesler)You can set these VM properties in your IDE debugger to direct log4j output to a logfile or the console
-Dlog4j.output.dir=${workspace_loc:jboss-osgi-framework/target}
or
-Dlog4j.configuration=log4j-console.xml