Note that there are some explanatory texts on larger screens.

plurals
  1. POMake Akka aware of Play's logback configuration
    primarykey
    data
    text
    <p>How do I make Akka aware of Play's logback config (application-logger.xml)?<br> In my case it is completely ignored:</p> <h3>The log is ONLY printed to stdout. I expect it to be logged to the File-Appender defined in application-logger.xml</h3> <h3>It does not make a difference if I rename application-logger.xml to logback.xml.</h3> <h1>Actor-class:</h1> <pre><code>class Dispatcher extends Actor with ActorLogging { // prints to stdout ONLY: log.error("[akka-logger] dispatch started...") } </code></pre> <h1>conf/application.conf:</h1> <pre><code>play { akka { #log-config-on-start = on loggers = ["akka.event.slf4j.Slf4jLogger"] event-handlers = ["akka.event.slf4j.Slf4jEventHandler"] loglevel = DEBUG # and so on... } </code></pre> <h1>conf/application-logger.xml</h1> <pre><code>&lt;configuration&gt; &lt;appender name="FILE" class="ch.qos.logback.core.FileAppender"&gt; &lt;file&gt;${application.home}/logs/application.log&lt;/file&gt; &lt;encoder&gt; &lt;pattern&gt;%date - [%level] - from %logger in %thread %n%message%n%xException%n&lt;/ pattern&gt; &lt;/encoder&gt; &lt;/appender&gt; &lt;!-- Using akka.event.slf4j.EventHandler does NOT make a difference here: --&gt; &lt;logger name="akka.event.slf4j.Slf4jLogger" level="ERROR" additivity="false"&gt; &lt;appender-ref ref="FILE"/&gt; &lt;/logger&gt; &lt;logger name="play" level="ERROR" additivity="false"&gt; &lt;appender-ref ref="FILE"/&gt; &lt;/logger&gt; &lt;logger name="application" level="ERROR" additivity="false"&gt; &lt;appender-ref ref="FILE"/&gt; &lt;/logger&gt; &lt;root level="ERROR"&gt; &lt;appender-ref ref="STDOUT"/&gt; &lt;appender-ref ref="FILE"/&gt; &lt;/root&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload