How to use logback in a PlayFramework project

Due to project dependencies, I am working on developing a web application using Play! Framework, I need to configure logback so that it does not flood my output with DEBUG messages. But since log4j is the default log library used by the Play platform! Framework, I really don't know how to get her to view the logback.xml configuration file.

Best of all would be to force Play! Framework make full use of logback / Slf4j instead of log4j. How can i do this?

+4
source share
1 answer

Currently play1 uses log4j or juli (I'm not sure if juli works, but the code exists). There is a feature-request , but unfortunately you cannot use the login correctly if you have one Logger.class. In this case,% F and all other uppercase characters from PatternLayout , which is discussed.

Update . After some information from Ceki, I now know how to fix this in a clean way. Thus, a function request can be implemented in a clean way.

The idea might be to log4j to logback if possible. Also, I am thinking of creating a patch that solves this problem. Therefore, I do not want to start until this is fixed, and I receive signals from the main team that they accept any repeated factoring in such a central class.

In short: at the moment, this is impossible without breaking the framework. However, I do not understand your problem. What do you want to do so that log4j cannot? Perhaps you could explain your root cause in another question.

+2
source

All Articles