Skip to content

Instantly share code, notes, and snippets.

@Shiti
Last active August 29, 2015 14:03
Show Gist options
  • Save Shiti/6f3da9bd7a8fc901c96f to your computer and use it in GitHub Desktop.
Save Shiti/6f3da9bd7a8fc901c96f to your computer and use it in GitHub Desktop.
sample configurations to enable logging in a Play application with a third party library that uses Akka
# This is the main configuration file for the application.
# ~~~~~
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="someHellOfASecret"
# The application languages
# ~~~~~
application.langs="en"
# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
# application.global=Global
# Router
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `my.application.Router`,
# you may need to define a router file `conf/my.application.routes`.
# Default to Routes in the root package (and conf/routes)
# application.router=my.application.Routes
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""
# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled
# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
# Root logger:
logger.root=ERROR
# Logger used by the framework:
logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
play.akka.loglevel="DEBUG"
third-party-lib{
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
}
}
<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>
<logger name="play" level="DEBUG"/>
<logger name="application" level="DEBUG"/>
<logger name="com.project.actors" level="DEBUG"/>
<logger name="third.party.lib.actors" level="DEBUG"/>
<root level="DEBUG">
<appender-ref ref="FILE"/>
</root>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment