[Play 2.2.x Scala] Disable logging during startup

266 views
Skip to first unread message

René Grüner Vangsgaard

unread,
Apr 7, 2015, 4:43:26 PM4/7/15
to play-fr...@googlegroups.com
During startup a lot of logging is going on about Logback itself. Can I disable it. It is especially annoying when testing specs.

Thank you,
René

René Grüner Vangsgaard

unread,
Jun 8, 2015, 7:31:18 AM6/8/15
to play-fr...@googlegroups.com
As a workaround I disable the stdout appender.

For reference:

<configuration>

   
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />

   
<property scope="local" name="defaultPattern" value="%date{yyyy-MM-dd HH:mm:ss Z,UTC} %-5level %logger{1} ~ %message%xException%n"/>

   
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
       
<file>./logs/application.log</file>
       
<encoder>
           
<pattern>${defaultPattern}</pattern>
       
</encoder>
   
</appender>

   
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
       
<encoder>
           
<pattern>${defaultPattern}</pattern>
       
</encoder>
   
</appender>

   
<logger name="play" level="INFO" />
   
<logger name="application" level="DEBUG" />

   
<root level="INFO">
       
<appender-ref ref="FILE" />
   
</root>

</configuration>

Will Sargent

unread,
Jun 8, 2015, 8:59:49 AM6/8/15
to play-fr...@googlegroups.com
You probably have more than one SLF4J logger defined.  You should define the debug mode in logback.xml with: 

<configuration debug="true"> 


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/3d476937-1197-448e-b39f-7ceae51484a4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

René Grüner Vangsgaard

unread,
Jun 9, 2015, 4:30:25 AM6/9/15
to play-fr...@googlegroups.com
Thanks for the answer. I actually had an error in my Logback configuration, though it wasn't multiple SLF4J loggers. I was using ScalyrAppender (https://github.com/scalyr/scalyr-logback) with nested XML which wasn't valid for this appender.
Reply all
Reply to author
Forward
0 new messages