Hello,

 

After sending thousands of requests to our app, we stop the sender and the
log file appears like below:

 

1,54.38.179.175,2018-09-27
16:55:51.618,A,13,A,39,A,72,A,120,N,,54.38.179.182:8080,g,8457,403,683,58,ok
,2018-09-27 16:55:51.677

1,54.38.179.17

 

Now we stop tomcat (when our app is running). And it seems the queue of
pending events is not flushed, so the log remains like above. Our log
configuration is:

 

<RollingRandomAccessFile name="ACCESS_LOG"
fileName="${sys:log.dir}vproxy_access"
filePattern="${sys:log.dir}vproxy_access.%d{yyyy-MM-dd}" append="true"
immediateFlush="false">

<PatternLayout>

Pattern>%m%d{yyyy-MM-dd HH:mm:ss.SSS}%n</Pattern>

</PatternLayout>

<Policies>

<CronTriggeringPolicy schedule="0 0 0 * * ?" evaluateOnStartup="true" />

</Policies>

</RollingRandomAccessFile>

 

<Logger name="LOGGER_ACCESS" level="info" includeLocation="false"
additivity="false">

<AppenderRef ref="ACCESS_LOG"/>

</Logger>

 

 

Can we tell log4j2 to flush these pending lines when we shutdown our app?

 

Thanks,

Joan.

 

Reply via email to