[logback-dev] [JIRA] (LOGBACK-1411) Overwrite file contents when restarted

QOS.CH (JIRA) noreply-jira at qos.ch
Sun Jul 1 13:10:00 CEST 2018

alinger created LOGBACK-1411:

             Summary: Overwrite file contents when restarted
                 Key: LOGBACK-1411
                 URL: https://jira.qos.ch/browse/LOGBACK-1411
             Project: logback
          Issue Type: Bug
    Affects Versions: 1.2.3, 1.1.11
         Environment: <?xml version="1.0" encoding="utf-8"?>


 <property name="LOG_HOME" value="d:/imgtest/log"/> 

 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> 

 <layout class="ch.qos.logback.classic.PatternLayout"> 

 <pattern>%d\{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger\{50} - %msg%n</pattern> 
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

 <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
 <!-- rollover daily -->
 <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
 <pattern>%d\{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger\{50} - %msg%n</pattern> 

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

            Reporter: alinger
            Assignee: Logback dev list

When I use RollingFileAppender and SizeAndTimeBasedRollingPolicy to set <append>true</append> and <file>log.log</file> at the same time, but when I stop and restart on the same day, the original contents of the log.log file are emptied, but the original content does not generate a rolling file, and you can't find the original content anywhere.

This message was sent by Atlassian JIRA

More information about the logback-dev mailing list