title: How to avoid multiple log files in slf4j logging?
body: <p>I am implementing SLF4J logging with logback.xml but application is creating multiple log files.
  I need to create one single log file for a date with all the log levels in same log files.</p>
  
  <p>Below is my logback.xml configuration.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;property name="LOG_FILE_LOCATION" value="./log/" /&gt;
  
      &lt;appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;layout class="ch.qos.logback.classic.PatternLayout"&gt;
              &lt;Pattern&gt;[%d{yyyy-MM-dd HH:mm:ss}] [%thread] [%-5level] [%logger] - %msg%n&lt;/Pattern&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
  
      &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&gt;
              &lt;pattern&gt;[%d{yyyy-MM-dd HH:mm:ss}] [%thread] [%-5level] [%logger] - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
  
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${LOG_FILE_LOCATION}/manageng_%d{yyyy-MM-dd_HH-mm-ss}.log&lt;/fileNamePattern&gt;
              &lt;timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"&gt;
                  &lt;maxFileSize&gt;10MB&lt;/maxFileSize&gt;
              &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
          &lt;/rollingPolicy&gt;
      &lt;/appender&gt;
  
  
      &lt;appender name="FILE-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&gt;
              &lt;Pattern&gt;[%d{yyyy-MM-dd HH:mm:ss}] [%thread] [%-5level] [%logger] - %msg%n&lt;/Pattern&gt;
          &lt;/encoder&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${LOG_FILE_LOCATION}/manageng_error_%d{yyyy-MM-dd_HH-mm-ss}.log&lt;/fileNamePattern&gt;
              &lt;timeBasedFileNamingAndTriggeringPolicy
                  class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"&gt;
                  &lt;maxFileSize&gt;10MB&lt;/maxFileSize&gt;
              &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
          &lt;/rollingPolicy&gt;
      &lt;/appender&gt;
  
  
      &lt;logger name="net.indecomm.manageng" level="debug" additivity="false"&gt;
          &lt;appender-ref ref="FILE"/&gt;
          &lt;appender-ref ref="CONSOLE"/&gt;
      &lt;/logger&gt;
  
      &lt;root level="ERROR"&gt;
          &lt;appender-ref ref="FILE-ERROR"/&gt;
          &lt;appender-ref ref="CONSOLE"/&gt;
      &lt;/root&gt;
  
  
  &lt;/configuration&gt;
  </code></pre>