You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ragamalika (JIRA)" <ji...@apache.org> on 2018/11/19 10:19:00 UTC

[jira] [Created] (LOG4J2-2512) On timebasedroolingover- file is unable to roll over and stopping the tomcat instance/application

Ragamalika created LOG4J2-2512:
----------------------------------

             Summary: On timebasedroolingover- file is unable to roll over and stopping the tomcat instance/application
                 Key: LOG4J2-2512
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2512
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.8.1
            Reporter: Ragamalika


We are using logj2.xml in our application(Application is running on tomcat and in windows machine). We have set timebasedrollingover on daily basis.

When it try to roll over we get one error and stop the application\

INFO [https-jsse-nio-2443-exec-1] org.apache.catalina.core.StandardWrapperValve.invoke 2018-11-18 00:00:10,921 https-jsse-nio-2443-exec-1 ERROR Unable to move file D:\apps\logs\eDoc\inst02\eDocAudit.log to D:\apps\logs\eDoc\inst02\eDocAudit.log.2018-11-17: java.nio.file.FileSystemException D:\apps\logs\eDoc\inst02\eDocAudit.log -> D:\apps\logs\eDoc\inst02\eDocAudit.log.2018-11-17: The process cannot access the file because it is being used by another process.

 

Here is my log4j2.xml:

 

<?xml version="1.0" encoding="utf-8"?>
 <Configuration status="info" packages="ei.util">
 <Loggers>
 <root level="warn">
 <appender-ref ref="traceAppender" /> 
 <appender-ref ref="edocTraceAppender" />
 </root>
 <Logger name="eDocAudit" level="all" >
 <appender-ref ref="auditAppender" level="all"/>
 </Logger>

</Loggers>

<Appenders>
 <RollingFile name="traceAppender" fileName="H:/logs/eDocServer/${sys:jvm.name}/eDocLogs.htm" filePattern="H:/logs/eDocServer/${sys:jvm.name}/eDocLogs.htm.%d\{yyyy-MM-dd}" >
 <HTMLlayout charset="UTF-8" title="eDocAudit logs" locationInfo="true" />
 <Policies>
 <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
 </Policies> 
 </RollingFile> 
 <RollingFile name="auditAppender" fileName="H:/logs/eDocServer/${sys:jvm.name}/eDocAudit.log" filePattern="H:/logs/eDocServer/${sys:jvm.name}/eDocAudit.log.%d\{yyyy-MM-dd}" >
 <PatternLayout>
 <pattern>%m%n</pattern>
 </PatternLayout>
 <Policies>
 <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
 </Policies>
 </RollingFile>

<RollingFile name="edocTraceAppender" fileName="H:/logs/eDocServer/${sys:jvm.name}/eDocTrace.log" 
 filePattern="H:/logs/eDocServer/${sys:jvm.name}/eDocTrace.log.%d\{yyyy-MM-dd}" >
 <PatternLayout>
 <pattern>%d\{dd/MMM/yyyy HH:mm:ss,SSS}- %c\{1}: %m%n</pattern>
 </PatternLayout>
 <Policies>
 <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
 </Policies>

</RollingFile>

</Appenders>
 </Configuration>



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)