All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lmos-cache.1.0.2u9.source-code.logback.xml Maven / Gradle / Ivy

There is a newer version: 1.0.2u10
Show newest version
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration>  
  
<configuration> 
    <substitutionProperty name="log.base" value="c:\\logback\\logback" />   
    <jmxConfigurator />  
      
    <!-- 控制台输出日志 -->  
    <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{36} - %msg%n</pattern>  
        </layout>  
    </appender>  
      
    <!-- 文件输出日志 (文件大小策略进行文件输出,超过指定大小对文件备份)-->  
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">  
        <File>xxxx.log</File>  
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">  
            <FileNamePattern>xxxx.log.%i.bak</FileNamePattern>  
            <MinIndex>1</MinIndex>  
            <MaxIndex>12</MaxIndex>  
        </rollingPolicy>  
  
        <triggeringPolicy  
            class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">  
            <MaxFileSize>100MB</MaxFileSize>  
        </triggeringPolicy>  
        <layout class="ch.qos.logback.classic.PatternLayout">  
            <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>  
        </layout>  
    </appender>  
    
    <appender name="FILE-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">  
         <filter class="ch.qos.logback.classic.filter.LevelFilter">  
            <level>ERROR</level>  
            <OnMismatch>DENY</OnMismatch>  
            <OnMatch>ACCEPT</OnMatch>  
        </filter>  
          
        <File>cache-err.log</File>  
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">  
            <FileNamePattern>cache-err.log.%i.bak</FileNamePattern>  
            <MinIndex>1</MinIndex>  
            <MaxIndex>3</MaxIndex>  
        </rollingPolicy>  
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">  
            <MaxFileSize>100MB</MaxFileSize>  
        </triggeringPolicy>  
        <layout class="ch.qos.logback.classic.PatternLayout">  
            <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>  
        </layout>  
    </appender>  
  
  <!--这里指定logger name 是为jmx设置日志级别做铺垫 -->         
    <logger name="com.holmos.cache">  
        <level value="INFO" />  
        <appender-ref ref="STDOUT" />  
        <appender-ref ref="FILE" />  
        <appender-ref ref="FILE-ERROR" />  
    </logger>  
</configuration>  




© 2015 - 2024 Weber Informatics LLC | Privacy Policy