Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2512

On timebasedrollingover- file is unable to roll over and stopping the tomcat instance/application

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: 2.8.1
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      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">

      <Loggers>
      <root level="warn">
      <appender-ref ref="traceAppender" />
      </root>
      <Logger name="eDocAudit" level="all" >
      <appender-ref ref="auditAppender" level="all"/>
      </Logger>
      </Loggers>

      <Appenders>
      <RollingFile name="auditAppender" fileName="D:/apps/logs/eDoc/${sys:jvm.name}/eDocAudit.log" filePattern="D:/apps/logs/eDoc/${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="traceAppender" fileName="D:/apps/logs/eDoc/${sys:jvm.name}/eDocTrace.log" filePattern="D:/apps/logs/eDoc/${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>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              CHR Ragamalika
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: