I wrote a play 2.2.1 application and I have problems with logging. I defined a logger per class in this way:
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
public class Foo extends Controller {
private static Logger logger = LoggerFactory.getLogger(Foo.class);
public Result bar(){
logger.info("Bar called");
.
.
.
}
}
I am not using a logger.xml
. Everything perfectly works in dev
mode and every class logs fine. When I run in dist
mode, it stops logging after the application is started. Any idea about what I am doing wrong or what else could I check?
Thanks in advance!
I would check log level, probably try setting it explicitly (in conf): logger=DEBUG
I managed to have the logger running adding a
logger.xml
file and explicitly calling it with the-Dlogger.file
option. I am a bit confused by the fact that all that should be logged bacause of the Global.onStart() method was correctly logged, while, after the application was started, there was no more logs (but only ondist
mode, with therun
mode logs where fine).Maybe my issue is related with this other question.