Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
1.1.7
-
List of log jars in my project:
springframework-3.1.1-RELEASE
slf4j-api-1.7.25
jcl-over-slf4j-1.7.25(Used to replace commons-logging-1.0.3)
log4j-over-slf4j-1.7.25(Used to replace log4j-1.2.15)
logback-core-1.1.7
logback-classic-1.1.7
logback.xml:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<contextName>my-test</contextName><appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder charset="UTF-8">
<ImmediateFlush>false</ImmediateFlush>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %X{threadId:--}%X{clientIp} %c{0}:%L: %m%n</pattern>
</encoder>
<File>c:/test.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>c:/test.log%d{yyyyMMdd}</fileNamePattern>
<maxHistory>2</maxHistory>
</rollingPolicy>
</appender>
<appender name="asyncLogFile" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<neverBlock>true</neverBlock>
<queueSize>2048</queueSize>
<includeCallerData>true</includeCallerData>
<appender-ref ref="logFile" />
</appender><appender name="errorLogFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<encoder charset="UTF-8">
<ImmediateFlush>false</ImmediateFlush>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %X{threadId:--}%X{clientIp} %c{0}:%L: %m%n</pattern>
</encoder>
<File>c:/error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>c:/error.log%d{yyyyMMdd}</fileNamePattern>
<maxHistory>2</maxHistory>
</rollingPolicy>
</appender>
<appender name="asyncErrorLogFile" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<neverBlock>true</neverBlock>
<queueSize>2048</queueSize>
<includeCallerData>true</includeCallerData>
<appender-ref ref="errorLogFile" />
</appender><logger name="RocketmqClient" level="error" />
<logger name="RocketmqRemoting" level="error" />
<logger name="com.ibatis" level="INFO" />
<logger name="java.sql.Connection" level="INFO" />
<logger name="java.sql.Statement" level="INFO" />
<logger name="java.sql.PreparedStatement" level="INFO" /><root level="INFO">
<appender-ref ref="asyncLogFile" />
<appender-ref ref="asyncErrorLogFile" />
</root>
</configuration>List of log jars in my project: springframework-3.1.1-RELEASE slf4j-api-1.7.25 jcl-over-slf4j-1.7.25(Used to replace commons-logging-1.0.3) log4j-over-slf4j-1.7.25(Used to replace log4j-1.2.15) logback-core-1.1.7 logback-classic-1.1.7 logback.xml: <?xml version="1.0" encoding="UTF-8"?> <configuration debug="false"> <contextName>my-test</contextName> <appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>INFO</level> </filter> <encoder charset="UTF-8"> <ImmediateFlush>false</ImmediateFlush> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %X{threadId:--}%X{clientIp} %c{0}:%L: %m%n</pattern> </encoder> <File>c:/test.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>c:/test.log%d{yyyyMMdd}</fileNamePattern> <maxHistory>2</maxHistory> </rollingPolicy> </appender> <appender name="asyncLogFile" class="ch.qos.logback.classic.AsyncAppender"> <discardingThreshold>0</discardingThreshold> <neverBlock>true</neverBlock> <queueSize>2048</queueSize> <includeCallerData>true</includeCallerData> <appender-ref ref="logFile" /> </appender> <appender name="errorLogFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> <encoder charset="UTF-8"> <ImmediateFlush>false</ImmediateFlush> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %X{threadId:--}%X{clientIp} %c{0}:%L: %m%n</pattern> </encoder> <File>c:/error.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>c:/error.log%d{yyyyMMdd}</fileNamePattern> <maxHistory>2</maxHistory> </rollingPolicy> </appender> <appender name="asyncErrorLogFile" class="ch.qos.logback.classic.AsyncAppender"> <discardingThreshold>0</discardingThreshold> <neverBlock>true</neverBlock> <queueSize>2048</queueSize> <includeCallerData>true</includeCallerData> <appender-ref ref="errorLogFile" /> </appender> <logger name="RocketmqClient" level="error" /> <logger name="RocketmqRemoting" level="error" /> <logger name="com.ibatis" level="INFO" /> <logger name="java.sql.Connection" level="INFO" /> <logger name="java.sql.Statement" level="INFO" /> <logger name="java.sql.PreparedStatement" level="INFO" /> <root level="INFO"> <appender-ref ref="asyncLogFile" /> <appender-ref ref="asyncErrorLogFile" /> </root> </configuration>
Description
Hello,good programmers!
When high concurrency, the log will be printed twice,but Not necessarily, the probability is about 2%:
like this:
2019-01-01 14:11:55.766 [INFO ] <T=L0MW82ZxY002Fupw><IP=10.55.63.113> GSOneAuthSource:111: loginName=testetsss,auth in redis,authResult=true
2019-01-01 14:11:55.767 [INFO ] <T=L0MW82ZxY002Fupw><IP=10.55.63.113> GSOneAuthSource:111: loginName=testetsss,auth in redis,authResult=true
Has anyone ever encountered such a problem, is there any solution?
thanks!