日志

参考博客:http://tengj.top/2017/04/05/springboot7/

https://www.cnb

xml version="1.0" encoding="UTF-8"?>
<configuration  scan="true" scanPeriod="60 seconds" debug="false">
    <contextName>logbackcontextName>
    <property name="log.path" value="../test/log" />
    
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%npattern>
        encoder>
    appender>

    
    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${log.path}/logback.%d{yyyy-MM-dd}.logfileNamePattern>
            <totalSizeCap>1GBtotalSizeCap>
        rollingPolicy>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%npattern>
        encoder>
    appender>

    <root level="info">
        <appender-ref ref="console" />
        <appender-ref ref="file" />
    root>

    
    
    
    
        
    
configuration>

 

 

logs.com/bigdataZJ/p/springboot-log.html

你可能感兴趣的:(日志)