0

我有滚动文件附加程序设置如下

  <appender name="ACCESS_S3" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/opt/mycompany/${application}-server/access/localwebserver.extended.log
    </file>
    <append>true</append>
    <rollingPolicy
            class="com.mycompnay.logback.core.rolling.S3TimeBasedRollingPolicy">
        <fileNamePattern>/opt/mycompany/${application}-server/access/%d{yyyy-MM-dd-HHmm}.log
        </fileNamePattern>
        <maxHistory>60</maxHistory>
        <configBucketKey>com.mycompany.log.bucket</configBucketKey>
        <s3FolderName>
            ${application}/access/${servername}_
        </s3FolderName>
    </rollingPolicy>
    <encoder>
        <pattern>${encoderPattern}</pattern>
    </encoder>

但是我从 appender 本身获取有关控制台上文件上传、重命名等的日志,例如 ->

INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1481886288 - Uploading /opt/mycompnay/myapp-server/access/2018-04-09-1542.log

我想禁用上面的日志,我该怎么做?

4

1 回答 1

2

降低 TimeBasedRollingPolicy 类的日志记录级别

<logger name="ch.qos.logback.core.rolling.TimeBasedRollingPolicy" 
   level="ERROR">
   <appender-ref ref="ACCESS_S3" />
</logger>
于 2018-04-09T22:46:48.923 回答