Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play framework storing whole console output to log file

I would like to have all output from my play application to be stored in log file. To print information to console I use System.out.println() command; Please give me some hints how to configure play.

For now play is storing only something like this:

2014-01-23 15:15:53,134 - [INFO] - from play in main 
database [default] connected at jdbc:h2:/baza.sql

2014-01-23 15:15:54,591 - [INFO] - from play in main 
Application started (Prod)

Any help will be aprecieate. thanks!

like image 948
masterdany88 Avatar asked Sep 14 '25 08:09

masterdany88


1 Answers

Application level logging using scala:

import play.api.Logger._    
logger.info("Hooray! I am logging things")

Application level logging using java:

import play.Logger;
Logger.info("Hooray! I am logging things in java")

Additionally, Play uses logback as its logging engine. So as far as logging configuration goes, you have available to you the full power of logback. Have a look at the excellent Play docs on the subject.

like image 163
mantithetical Avatar answered Sep 16 '25 13:09

mantithetical