码迷,mamicode.com
首页 > 其他好文 > 详细

使用slf4j的时候,部署后,只有tomcat控制台有日志,没有每日日志,后台报错ROLLINGFILE

时间:2017-02-16 13:05:59      阅读:467      评论:0      收藏:0      [点我收藏+]

标签:ack   his   stream   inf   cep   ssi   out   log   com   

3:20:00,593 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[ROLLINGFILE] - Appender [ROLLINGFILE] failed to append. java.nio.channels.OverlappingFileLockException
at java.nio.channels.OverlappingFileLockException
at at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1063)
at at java.nio.channels.FileChannel.lock(FileChannel.java:1053)
at at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:229)
at at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:254)
at at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212)
at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:228)
at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:100)
at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:84)
at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:270)
at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:257)
at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421)
at at ch.qos.logback.classic.Logger.filterAndLog_2(Logger.java:414)
at at ch.qos.logback.classic.Logger.info(Logger.java:587)
at at com.lsxy.app.uusd.task.QiXunTongMassTaskLogTask.checkUserMassTask(QiXunTongMassTaskLogTask.java:50)
at at com.lsxy.app.uusd.task.QiXunTongMassTaskLogTask.hour(QiXunTongMassTaskLogTask.java:40)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at at java.lang.Thread.run(Thread.java:745)

 

看了下配置

 

<!-- 按照每天生成日志文件 -->
<appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<Prudent>true</Prudent>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/${APP_NAME}-%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>2GB</MaxFileSize>
</triggeringPolicy>
</appender>

没发现问题,后面发现少定义了

<property name="APP_NAME" value="app.message.uc" />
<property name="systemId" value="app.message.uc" />
<include resource="logback-yunhuni.xml"/>
<logger name="com.lsxy" level="DEBUG" additivity="true" />
<logger name="org.springframework" level="INFO" additivity="true" />
<logger name="com.lsxy.framework.web.utils.WebUtils" level="INFO" additivity="true" />


总结这个问题:看看是不是配置日志的文件漏写了什么吧~

使用slf4j的时候,部署后,只有tomcat控制台有日志,没有每日日志,后台报错ROLLINGFILE

标签:ack   his   stream   inf   cep   ssi   out   log   com   

原文地址:http://www.cnblogs.com/foreverzxb/p/6404737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!