2

OverlappingFileLockException在 LogBack 中点击以下内容。prudent此版本的 Logback 中的模式是否存在任何已知问题?

  • logback-classic 1.0.7
  • logback-core 1.0.7
  • slf4j-api 1.7.2
  • slf4j-ext 1.7.2

11:16:59,252 |-ch.qos.logback.core.rolling.RollingFileAppender[FILE_LOG] 中的错误 - 附加程序 [FILE_LOG] 无法附加。java.nio.channels.OverlappingFileLockException at java.nio.channels.OverlappingFileLockException at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152 ) 在 sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:972) 在 java.nio.channels.FileChannel.lock(FileChannel.java:1052) 在 ch.qos.logback.core.FileAppender.safeWrite (FileAppender.java:187) 在 ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) 在 ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.

<appender name="FILE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <prudent>true</prudent>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>C:/MyLog-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
        <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
            <maxFileSize>100MB</maxFileSize>
        </timeBasedFileNamingAndTriggeringPolicy>
        <maxHistory>10</maxHistory>
    </rollingPolicy>
    <encoder>
        <pattern>%d{HH:mm:ss.SSS}  [%-20.20(%thread)]  %-6level  %-30.30logger{0} - [%-12.12(S:%mdc{pucid}]) %msg%n</pattern>
    </encoder>
</appender>
4

1 回答 1

1

http://jira.qos.ch/browse/LOGBACK-864 Mahesh Chimanpure 说:“ timeBasedFileNamingAndTriggeringPolicy can not be used in prudent mode.

于 2013-06-18T19:56:56.580 回答