I created a simple unit test that happens
to test a class which logs to a slj4j logger. When running the
test I want to use the log4j implementation of slf4j, and
provide it with the traditional log4j.properties.
According to some posts on the internet you
should create a fragment for this, only containing the
properties file, and deploy that to the OSGI container.
This works when I run the test from eclipse
as a plug-in test, there I can specify the
log4j-properties-fragment in the list of plugins to deploy to
When I do a ‘run as junit test’ I
get this error message in my console:
Failed to load class "org.slf4j.impl.StaticLoggerBinder".
Defaulting to no-operation (NOP) logger implementation
See http://www.slf4j.org/codes.html#StaticLoggerBinder for
When I run the test with the tycho surefire
plugin 0.18.0 from the command line it says:
appenders could be found for logger
Please initialize the log4j system properly.
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more
My question: is there a way to have the
log4j logging working in all three scenario’s ?
Erik Vande Velde
Senior Software Coordinator
+32 (0)2 77 60 034 / Fax: +32 (0)2 77 60 319
E-mail: EvandeVelde@xxxxxxxx / Website: www.fugro.be
Address: Av. de Broqueville 12, 1150 Brussels, Belgium
VAT Nr: BE0418609636