user3271386
user3271386

Reputation: 35

How to setup Logging in PlayFramework for external jar

I'm using Play! Framework 2.2.x that includes a Jar-File in its lib directory, which should perform logging, but shall not depend on play.Logger but only on SLF4J. Unforunately I cannot find anything about this problem neither in Play documentation nor on StackOverflow.

In the external Jar file, SLF4J is used like in the SLF4J Manual:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HelloWorld {
  public void test() {
    Logger logger = LoggerFactory.getLogger(HelloWorld.class);
    logger.info("Hello World");
  }
}

Please help me out - any hints how to solve this? Thanks in advance, Manfred

Upvotes: 0

Views: 340

Answers (1)

Manuel Bernhardt
Manuel Bernhardt

Reputation: 3140

Play is using Logback as its logging system. If I am not mistaken, the SLF4J bindings are already provided in Play, so any library relying on SLF4J should be working. You can check how to configure things here

Upvotes: 1

Related Questions