Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 850
Rob Avatar asked Aug 08 '26 00:08

Rob


1 Answers

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

like image 95
Antony Stubbs Avatar answered Aug 10 '26 13:08

Antony Stubbs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!