You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
- <!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true -->
- <!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。
- 当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
- <!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
- <configuration scan="true" scanPeriod="60 seconds" debug="false">
- <!--
- contextName说明:
- 每个logger都关联到logger上下文,默认上下文名称为“default”。但可以使用设置成其他名字,
- 用于区分不同应用程序的记录。一旦设置,不能修改,可以通过%contextName来打印日志上下文名称。
- -->
- <contextName>tuoheng_oidc_server</contextName>
-
- <!--定义日志变量-->
- <!--<property name="logging.path" value="D:\\idealogs\\tuoheng_oidc"/>-->
- <property name="logging.path" value="/data/java/logs/tuoheng_oidc"/>
- <!--日志格式: [时间] [级别] [线程] [行号] [logger信息] - [日志信息]-->
- <property name="logging.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%level][%thread][%L] %logger - %msg%n"/>
- <property name="logging.charset" value="UTF-8"/>
- <property name="logging.maxHistory" value="15"/>
- <property name="logging.totalSizeCap" value="5GB"/>
- <property name="logging.maxFileSize" value="40MB"/>
-
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>${logging.pattern}</pattern>
- <charset>${logging.charset}</charset>
- </encoder>
- </appender>
-
- <appender name="LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <File>${logging.path}/server/tuoheng_oidc_server.log</File>
- <append>true</append>
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${logging.path}/server/tuoheng_oidc_server-%d-%i.log</fileNamePattern>
- <!-- 最大保存天数-->
- <maxHistory>${logging.maxHistory}</maxHistory>
- <totalSizeCap>${logging.totalSizeCap}</totalSizeCap>
- <maxFileSize>${logging.maxFileSize}</maxFileSize>
- </rollingPolicy>
- <!--编码器-->
- <encoder>
- <pattern>${logging.pattern}</pattern>
- <charset>${logging.charset}</charset>
- </encoder>
- </appender>
-
- <appender name="file.async" class="ch.qos.logback.classic.AsyncAppender">
- <discardingThreshold>0</discardingThreshold>
- <queueSize>512</queueSize>
- <includeCallerData>true</includeCallerData>
- <appender-ref ref="LOG_FILE" />
- </appender>
-
- <logger name="com.tuoheng" level="DEBUG" additivity="false">
- <appender-ref ref="console" />
- <appender-ref ref="file.async" />
- </logger>
- <!--log4jdbc -->
- <logger name="jdbc.sqltiming" level="DEBUG" additivity="false">
- <appender-ref ref="file.async" />
- </logger>
-
- <root level="INFO">
- <appender-ref ref="console" />
- <appender-ref ref="file.async" />
- </root>
- </configuration>
|