Ver código fonte

日志管理

zouxuan 1 ano atrás
pai
commit
b825ba8bf2
1 arquivos alterados com 1 adições e 42 exclusões
  1. 1 42
      cooleshow-app/src/main/resources/logback-spring.xml

+ 1 - 42
cooleshow-app/src/main/resources/logback-spring.xml

@@ -11,42 +11,6 @@
 		</encoder>
 	</appender>
 
-	<property name="FILE_PATH" value="/mnt/datadisk/logs/"/>
-	<property name="FILE_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:  %msg%n"/>
-	<!-- 日志最大保存数量 -->
-	<property name="MAX_HISTORY" value="10"/>
-	<!-- 日志文件大小 -->
-	<property name="FILE_SIZE" value="10MB"/>
-	<!-- sql文件,记录DEBUG级别日志 -->
-	<appender name="SQL_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-		<!-- 实时输出的日志文件 -->
-		<file>${FILE_PATH}/sys-sql.log</file>
-		<append>true</append>
-		<!-- 历史日志分块,配置滚动的策略 -->
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-			<!-- 日志名称的格式 -->
-			<fileNamePattern>${FILE_PATH}/app-sql.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 保存的最长时间:天数 -->
-			<MaxHistory>5</MaxHistory>
-		</rollingPolicy>
-		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-			<pattern>${FILE_PATTERN}</pattern>
-		</encoder>
-		<!--日志文件最大的大小-->
-		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-			<MaxFileSize>10MB</MaxFileSize>
-		</triggeringPolicy>
-		<!-- 过滤掉非debug的日志,即此日志文件中只会输出debug日志 -->
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
-			<!-- 过滤的级别 -->
-			<level>DEBUG</level>
-			<!-- 匹配时的操作:接收(记录) -->
-			<onMatch>ACCEPT</onMatch>
-			<!-- 不匹配时的操作:拒绝(不记录) -->
-			<onMismatch>DENY</onMismatch>>
-		</filter>
-	</appender>
-
 	<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
 		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
 			<FileNamePattern>${LOG_HOME}</FileNamePattern>
@@ -56,9 +20,6 @@
 				<MaxFileSize>20MB</MaxFileSize>
 			</TimeBasedFileNamingAndTriggeringPolicy>
 		</rollingPolicy>
-		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-			<level>DEBUG</level>
-		</filter>
 		<encoder>
 			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
 		</encoder>
@@ -73,7 +34,7 @@
 		<redisDb>10</redisDb>
 		<runModel>2</runModel>
 	</appender>
-	<logger name="com.yonge" level="INFO" />
+	<logger name="com.yonge" level="DEBUG" />
 
 	<!--本地环境:打印控制台 -->
 	<springProfile name="local">
@@ -101,7 +62,6 @@
 		<root level="INFO">
 			<appender-ref ref="stdout" />
 			<appender-ref ref="file" />
-			<appender-ref ref="SQL_FILE" />
 			<appender-ref ref="plumelog" />
 		</root>
 	</springProfile>
@@ -111,7 +71,6 @@
 		<root level="INFO">
 			<appender-ref ref="stdout" />
 			<appender-ref ref="file" />
-			<appender-ref ref="SQL_FILE" />
 			<appender-ref ref="plumelog" />
 		</root>
 	</springProfile>