Rob
Rob

Reputation: 11733

Is Logback Really Inside Play?

Working on an app using Akka 2 deployed with Play-mini. I pulled logback into the project and it works, but its config gets stomped so it was necessary to do a Joran configuration method and have that called at startup. Then I read that play had moved to logback so I rummaged around to see how to use the logger that's built into Play and figured it out, but as soon as I type:

Logger.debug(

it only supports:

debug(String message, Throwable error)
debug(String message)

The whole point of logback is the variable argument stuff so you don't have to dirty up your code with:

if (Logger.isDebugEnabled()){
     Logger.debug("my expensive message: " + largeObject.toString());
}

So I must be missing something. Docs are not great in this area either.

BTW, here is a thread about the config getting mussed.

Upvotes: 3

Views: 1370

Answers (1)

Antony Stubbs
Antony Stubbs

Reputation: 13585

Yes, Play is hard coded to use LogBack, and unless you specify, it takes over your log settings. Very annoying.

Stop Play from butchering logback settings : https://github.com/typesafehub/play2-mini/issues/7

Upvotes: 1

Related Questions