1
<configuration>
<appender name="FILE_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${application.home}/logs/debug_log.log</file>
    <encoder>
        <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
    </encoder>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>DEBUG</level>
    </filter>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>${application.home}/logs/debug_log.%d{yyyy-MM-dd}.log</fileNamePattern>
        <maxHistory>30</maxHistory>
    </rollingPolicy>
</appender>

<appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${application.home}/logs/warn_log.log</file>
    <encoder>
        <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
    </encoder>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>WARN</level>
    </filter>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>${application.home}/logs/warn_log.%d{yyyy-MM-dd}.log</fileNamePattern>
        <maxHistory>60</maxHistory>
    </rollingPolicy>
</appender>

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

<root level="WARN">
    <appender-ref ref="FILE_DEBUG"/>
    <appender-ref ref="FILE_WARN"/>
</root>
</configuration>

That is my current configuration prod.logger.xml where should i make changes?I would like to separate the application logs so when any issue arises its better to look into one file ie. debug_log.log file.

kailash yogeshwar
  • 836
  • 1
  • 9
  • 26
  • Play uses Logback for logging. Maybe this answer solves it already: http://stackoverflow.com/questions/9325260/defining-1-logback-file-per-level – Kris Nov 02 '15 at 17:10
  • i have tried as described in the answer but then to in production environment the [DEBUG] and [INFO] logs are appended to same file. – kailash yogeshwar Nov 03 '15 at 07:41

0 Answers0