Logging with SLF4J doesn't work

678 views
Skip to first unread message

ronge....@googlemail.com

unread,
Aug 6, 2014, 3:42:27 AM8/6/14
to camunda-...@googlegroups.com
Hi,

we want to implement SLF4J for logging in our camunda-project.
We are using eclipse kepler and maven(m2eclipse plugin).

We resolved the three error-code-lines
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

And now we want start logging while our project is running at Camunda Tasklist.

Our Settings for SLF4J in the pom-file:

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
</dependency>

And in the java-class for testing it:

private static Logger log = Logger.getLogger(OrderBusinessLogic.class.getName());

log.warn("Warning");
log.info("Info");
log.error("Error");

The problem is that we don't get any log.

Neither on the consele, maven console nor command-line interface.

Sebastian Menski

unread,
Aug 6, 2014, 10:18:32 AM8/6/14
to camunda-...@googlegroups.com, ronge....@googlemail.com
Hi,

camunda-bpm-platform currently does not use SLF4J. The three log lines

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

are produced by the springframework we use to bootstrap the platform.

You are free to choose a logging framework for your own code.

Also SLF4J does not provide a Logger.getLogger method, so your code seems not to use a SLF4J logger. Please
see the SLF4J manual for more information.

Cheers,
Sebastian

ronge....@googlemail.com

unread,
Aug 7, 2014, 3:37:19 AM8/7/14
to camunda-...@googlegroups.com, ronge....@googlemail.com
Oh sorry for posting the wrong logger.
This is the right one:

Logger log = LoggerFactory.getLogger(OrderBusinessLogic.class);



log.warn("Warning");
log.info("Info");
log.error("Error");

This one didn't work also.


Sebastian Menski

unread,
Aug 7, 2014, 3:50:20 AM8/7/14
to camunda-...@googlegroups.com, ronge....@googlemail.com
Hi,

what is your use case? How does camunda-bpm effect your own logging? Please
have a look at this small example. There I added SLF4J to the test case and used
it. You will find the following lines in the test output:

[main] INFO org.camunda.bpm.unittest.SimpleTestCase - Starting test case
[main] DEBUG org.camunda.bpm.unittest.SimpleTestCase - Got runtime- and taskService
[main] INFO org.camunda.bpm.unittest.SimpleTestCase - Process started
[main] DEBUG org.camunda.bpm.unittest.SimpleTestCase - Found task Task[7]
[main] INFO org.camunda.bpm.unittest.SimpleTestCase - Task completed
[main] INFO org.camunda.bpm.unittest.SimpleTestCase - Process ended


So does this help you?

Cheers,
Sebastian
Reply all
Reply to author
Forward
0 new messages