<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2015 Cloudera, Inc. All rights reserved.
  -->

<configuration debug="false" scan="true" scanPeriod="30 seconds">

    <property name="MAIN_LOG_FILE" value="${MAIN_LOG_FILE:-${LOG_DIR:-logs}/application.log}"/>
    <property name="FILE_LOG_PATTERN"
              value="[%date{yyyy-MM-dd HH:mm:ss}] %-5level [%thread] - %logger{36}: %msg%n"/>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <encoder>
            <pattern>${FILE_LOG_PATTERN}</pattern>
        </encoder>
        <file>${MAIN_LOG_FILE}</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${MAIN_LOG_FILE}.%i</fileNamePattern>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>10MB</MaxFileSize>
        </triggeringPolicy>
    </appender>

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

</configuration>

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2015 Cloudera, Inc. All rights reserved.
  -->

<configuration debug="false" scan="true" scanPeriod="30 seconds">

    <property name="MAIN_LOG_FILE" value="${MAIN_LOG_FILE:-${LOG_DIR:-logs}/application.log}"/>
    <property name="FILE_LOG_PATTERN"
              value="[%date{yyyy-MM-dd HH:mm:ss.SSS ZZ}] %-5level [%thread] - %logger{36}: %msg%n"/>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <encoder>
            <pattern>${FILE_LOG_PATTERN}</pattern>
        </encoder>
        <file>${MAIN_LOG_FILE}</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${MAIN_LOG_FILE}.%i</fileNamePattern>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>10MB</MaxFileSize>
        </triggeringPolicy>
    </appender>

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

</configuration>

Update logging to use milliseconds
Update logging to use milliseconds

Change the date format pattern to include millisecond and time zone
information in logging.

Original update by Dan Xu (dan.xu@cloudera.com).
