This sounds like a bug that has already been reported. I would suggest you try the CronTriggeringPolicy instead o the TimeBasedTriggeringPolicy.
Ralph > On Jun 2, 2017, at 3:19 AM, Joan Balagueró - ventusproxy > <joan.balagu...@ventusproxy.com> wrote: > > Hello, > > > > I致e posted this in stackoverflow, with no success. So I知 trying here now. > > > > I'm seeing the following behaviour in log4j2, not sure if it's the expected. > > > > This is part of my log4j.xml: > > <RollingFile name="ACCESS_LOG" > > > filePattern="${sys:log.dir}vproxy_access.%d{${sys:log.rotateAccess}}" > > append="true" > > bufferedIO="true" > > bufferSize="16384" > > immediateFlush="false"> > > > > <PatternLayout> > > <Pattern>%m%d{yyyy-MM-dd HH:mm:ss.SSS}%n</Pattern> > > </PatternLayout> > > > > <Policies> > > <TimeBasedTriggeringPolicy/> > > </Policies> > > > > </RollingFile> > > > > The log.rotateAccess is a system property than can have the values of > 'yyyy-MM-dd' for daily rotation or 'yyyy-MM-dd.HH' for hourly rotation. > > So, when I start to send requests to my app at 19:01 the > vproxy_access.2017-05-25.19 is correctly created and requests are logged. > This is the first line of this log: > > 1,88.0.193.186,2017-05-25 > 19:01:31.733,A,56,A,0,A,190,A,60,N,,,,2716,423,0,53,ok,2017-05-25 > 19:01:31.852 > > > > It's ok, but this is the last line: > > 1,167.114.89.180,2017-05-25 > 20:59:59.943,A,56,A,66,A,190,A,60,N,,,gzip,213161,323,5853,18,ok,2017-05-25 > 20:59:59.967 > > > > The file has rotated at 21:00 instead of 20:00. So the > vproxy_access.2017-05-25.20 contains all requests from 21:00:00 to 21:59:59. > > > > And if we check the vproxy_access.2017-05-25.23, the first and last line > are: > > 1,167.114.89.180,2017-05-25 > 23:59:59.984,A,56,A,0,A,190,A,60,N,,,gzip,165921,323,4683,12,ok,2017-05-26 > 00:00:00.002 > > ( . . . ) > > 1,167.114.89.180,2017-05-26 > 00:59:59.984,A,56,A,0,A,190,A,60,N,,,,147025,323,0,10,ok,2017-05-26 > 00:59:59.999 > > > > Furthermore, today we have stopped to send requests at 01:00 > (vproxy_access.2017-06-02.00). When we have started to send requests again > at 12:07, the log file vproxy_access.2017-06-02.01 has been created. This is > the first line: > > 1,167.114.89.180,2017-06-02 > 12:07:23.561,A,56,A,0,A,190,A,60,N,,167.114.89.180:80,gzip,151749,323,4335,8 > ,ok,2017-06-02 12:07:23.575 > > > > I need my vproxy_access.yyyy-MM-dd.HH to contain all lines from HH:00:00 to > HH:59:59 > > Any help would be very appreciated. > > Joan. > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org