Hello,
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 the container
When I do a ‘run as junit test’ I get this error message in my console:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
When I run the test with the tycho surefire plugin 0.18.0 from the command line it says:
log4j:WARN No appenders could be found for logger (com.fugro.gwf.common.domain.rules.aspects.BusinessRuleAspect).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
My question: is there a way to have the log4j logging working in all three scenario’s ?
Kind regards,
Fugro GeoConsulting
Erik Vande Velde
Senior Software Coordinator
Telephone: +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