Skip to content

Instantly share code, notes, and snippets.

@mitchellhislop
Last active December 18, 2015 21:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchellhislop/5850674 to your computer and use it in GitHub Desktop.
Save mitchellhislop/5850674 to your computer and use it in GitHub Desktop.
Logback xml for Scala/Play logging
db.default.logStatements=true
//Add that to the application.conf, and comment out the Logger lines (~50 - ~60). Restart the play app, and you are now logging with gas!
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${application.home}/logs/application.log</file>
<encoder>
<pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%coloredLevel %logger{15} - %message%n%xException{5}</pattern>
</encoder>
</appender>
<root level="ERROR">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
<logger name="com.jolbox.bonecp" level="DEBUG">
<appender-ref ref="STDOUT" />
</logger>
<logger name="play" level="INFO">
<appender-ref ref="STDOUT" />
</logger>
<logger name="application" level="INFO">
<appender-ref ref="STDOUT" />
</logger>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment