<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration scan="false">

  <!-- Silence Logback's own status messages about config parsing -->
  <statusListener class="ch.qos.logback.core.status.NopStatusListener" />

  <!-- Simple file output -->
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>

    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
      <!-- rollover daily -->
      <fileNamePattern>logs/pedestal-api-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
      <!-- or whenever the file size reaches 64 MB -->
      <maxFileSize>64 MB</maxFileSize>
    </rollingPolicy>

    <!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
    <prudent>false</prudent>
  </appender>

  <!-- Console output -->
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
    <encoder>
      <pattern>%-5level %logger{36} - %msg%n</pattern>
    </encoder>
    <!-- Only log level INFO and above -->
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>INFO</level>
    </filter>
  </appender>

  <!-- Enable FILE and STDOUT appenders for all log messages.
       By default, only log at level INFO and above. -->
  <root level="INFO">
    <appender-ref ref="FILE" />
    <appender-ref ref="STDOUT" />
  </root>

</configuration>

