How do I disable DEBUG log outputs completely?

974 views
Skip to first unread message

crocket

unread,
Apr 24, 2013, 8:39:49 AM4/24/13
to play-fr...@googlegroups.com
In conf/application.conf, I have those lines.

logger=OFF

logger.play=OFF

logger.application=OFF

And below is conf/prod-logger.conf

<configuration>
   
  <conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />
 
  <appender name="PlayFramework" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${application.home}/logs/application.log</file>
    <append>true</append>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>application.%d{yyyy-MM-dd}.log</fileNamePattern>
      <maxHistory>7</maxHistory>
    </rollingPolicy>
    <encoder>
      <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
    </encoder>
  </appender>

  <appender name="ZeroIrcLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${application.home}/logs/zeroirclog.log</file>
    <append>true</append>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>zeroirclog.%d{yyyy-MM-dd}.log</fileNamePattern>
      <maxHistory>7</maxHistory>
    </rollingPolicy>
    <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>
 
  <logger name="play" level="INFO" />
  <logger name="application" level="INFO" />
  <logger name="org.zeroirclog" level="INFO" additivity="false">
    <appender-ref ref="ZeroIrcLog" />
    <appender-ref ref="STDOUT" />
  </logger>

  <root level="ERROR">
    <appender-ref ref="PlayFramework" />
    <appender-ref ref="STDOUT" />
  </root>
 
</configuration>

Even with those configuration files, when I deploy my play framework project, I see lots of DEBUG outputs in application.log

2013-04-24 21:35:59,109 - [DEBUG] - from play in main
Plugin [play.api.db.BoneCPPlugin] is disabled

2013-04-24 21:35:59,142 - [DEBUG] - from play in main
Plugin [play.api.db.evolutions.EvolutionsPlugin] is disabled

2013-04-24 21:35:59,692 - [DEBUG] - from net.sf.ehcache.config.ConfigurationFactory in main
Configuring ehcache from ehcache.xml found in the classpath: jar:file:/misc/data/service/ZeroIrcLog/target/staged/play_2.10.jar!/ehcache.xml

......
....

How can I disable the annoying DEBUG logs?

Torben

unread,
Apr 24, 2013, 10:59:42 AM4/24/13
to play-fr...@googlegroups.com
It looks like you are missing the configuration directive telling Play where your log configuration file is. Try this:

logback.configurationFile=prod-logger.conf


HTH

- Torben

crocket

unread,
Apr 24, 2013, 7:01:49 PM4/24/13
to play-fr...@googlegroups.com
I start my project with "start -Dlogger.file=conf/prod-logger.conf", and it recognizes prod-logger.conf properly.
I specified in that file that all logs should be INFO and higher.
However, in the early stage of my play program startup, all sorts of DEBUG and INFO logs are logged.
Those DEBUG and INFO logs occupy ~19kilobytes.

crocket

unread,
Apr 27, 2013, 2:10:18 AM4/27/13
to play-fr...@googlegroups.com
I succeeded in muffling DEBUG outputs.

I just had to run "play stage" again before seeing the changes take effect.

I usually start my play application by executing target/start.


On Wednesday, April 24, 2013 11:59:42 PM UTC+9, Torben wrote:
Reply all
Reply to author
Forward
0 new messages