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

Rollover startegy failing on high load

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.8
    • Component/s: Appenders
    • Labels:
      None

      Description

      On windows virtual machines, the roll over strategy simply fails and the log size becomes huge. This happens on high load on tomcat server.
      Log4j2 is loaded from our application using below configuration

      <?xml version="1.0" encoding="UTF-8"?>
      <Configuration status="OFF">
      
      	<!-- Appenders -->
      	<Appenders>
      
      		<RollingFile name="xxxRootAppender"
      			fileName="${sys:catalina.base}/logs/xvx/com.xvx.connector.log"
      			filePattern="${sys:catalina.base}/logs/xvx/com.xvx.connector-%d{dd-MM-yyyy}#%i.log">
      			<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}][%t][%p] %m%n" />
      			<Policies>
      				<TimeBasedTriggeringPolicy />
      				<SizeBasedTriggeringPolicy size="100 MB" />
      			</Policies>
      			<DefaultRolloverStrategy max="50" />
      		</RollingFile>
      
      		<RollingFile name="xxxRequestResponseAppender"
      			fileName="${sys:catalina.base}/logs/xvx/com.xvx.connector-request-response.log"
      			filePattern="${sys:catalina.base}/logs/xvx/com.xvx.connector-request-response-%d{dd-MM-yyyy}#%i.log">
      			<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}][%t][%p] %m%n" />
      			<Policies>
      				<TimeBasedTriggeringPolicy />
      				<SizeBasedTriggeringPolicy size="100 MB" />
      			</Policies>
      			<DefaultRolloverStrategy max="50" />
      		</RollingFile>
      
      		<RollingFile name="xxxTimeAppender"
      			fileName="${sys:catalina.base}/logs/xvx/com.xvx.connector-time.log"
      			filePattern="${sys:catalina.base}/logs/xvx/com.xvx.connector-time-%d{dd-MM-yyyy}#%i.log">
      			<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}][%t][%p] %m%n" />
      			<Policies>
      				<TimeBasedTriggeringPolicy />
      				<SizeBasedTriggeringPolicy size="100 MB" />
      			</Policies>
      			<DefaultRolloverStrategy max="50" />
      		</RollingFile>
      
      		<!-- Spring framework Appender -->
      		<RollingFile name="springFrameworkAppender"
      			fileName="${sys:catalina.base}/logs/xvx/org.springframework.log"
      			filePattern="${sys:catalina.base}/logs/xvx/org.springframework-%d{dd-MM-yyyy}#%i.log">
      			<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}][%t][%p] %m%n" />
      			<Policies>
      				<TimeBasedTriggeringPolicy />
      				<SizeBasedTriggeringPolicy size="100 MB" />
      			</Policies>
      			<DefaultRolloverStrategy max="50" />
      		</RollingFile>
      
      		<!-- Spring jdbc Appender -->
      		<RollingFile name="springjdbcAppender"
      			fileName="${sys:catalina.base}/logs/xvx/org.springframework.jdbc.log"
      			filePattern="${sys:catalina.base}/logs/xvx/org.springframework.jdbc-%d{dd-MM-yyyy}#%i.log">
      			<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}][%t][%p] %m%n" />
      			<Policies>
      				<TimeBasedTriggeringPolicy />
      				<SizeBasedTriggeringPolicy size="100 MB" />
      			</Policies>
      			<DefaultRolloverStrategy max="50" />
      		</RollingFile>
      	</Appenders>
      
      	<Loggers>
      		<!-- 3rdparty Loggers -->
      		<Logger name="com.github.isrsal.logging.LoggingFilter" level="DEBUG" additivity="false">
      			<AppenderRef ref="xxxRequestResponseAppender" />
      		</Logger>
      
      		<Logger name="connector.timeLogger" level="OFF" additivity="false">
      			<AppenderRef ref="xxxTimeAppender" />
      		</Logger>
      
      		<Logger name="org.springframework" level="OFF" additivity="false">
      			<AppenderRef ref="springFrameworkAppender" />
      		</Logger>
      
      		<Logger name="org.springframework.jdbc" level="ALL" additivity="false">
      			<AppenderRef ref="springjdbcAppender" />
      		</Logger>
      
      		<!-- Root Logger -->
      		<Root level="ALL">
      			<AppenderRef ref="xxxRootAppender" />
      		</Root>
      	</Loggers>
      </Configuration>
      

      we are using slf4j 1.7.7

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              rgoers Ralph Goers
              Reporter:
              binoy.varghese@leanswift.com Binoy Varghese

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment