Thank you, Ralph. Yes, it is windows, and it was behaving strangely. 
Officially, there were no open files according to Windows' open files list, but 
it still didn't work. I then tried to shut down the service and rename the 
file. It gave an error and told me the file was open by the system. I clicked 
retry, and it worked fine. Very strange. 

If there was an error message in the logs about this, it would at least show up 
in log monitoring tools. I noticed it because our monitoring tools showed me 
old errors, but otherwise it would have just filled up disc space, and I am not 
sure what would happen once it reached the max log file size...

Charl

-----Original Message-----
From: Ralph Goers [mailto:[email protected]] 
Sent: Monday, May 9, 2016 11:22 AM
To: Log4J Users List
Subject: Re: time based file roller anomoly

Are you running on Windows?  We have had reports of similar behavior recently.  
I would check to see if something else is holding a lock on the file.  I 
believe the problem happens when the rollover tries to rename the file. If it 
is locked the rename will fail. It will then copy the file and then try to 
delete it. The delete also fails. Since we are still using File.delete we don’t 
get any useful information on the failure so we don’t log anything.  I plan to 
change that to use a newer API but that will only tell you there was a problem.

Ralph

> On May 9, 2016, at 5:10 AM, Van Jaarsveldt, Charl <[email protected]> 
> wrote:
> 
> Hi,
> We have a cluster of 16 machines, all running the same code with the same 
> log4j2 config. It has been logging fine for months, when suddenly – on May 
> 1st – the original log file stopped resetting on ONE of the machines, so 
> since then the main log file has been growing every day with the first log 
> entry from 5/1. Everything else is still logging fine. I checked the config, 
> and it did not change on this one machine. Additionally, I restarted the 
> service on that machine on Friday, thinking it had something to do with the 
> internal state of that service, but the problem did not resolve.
> 
> We’re using log4j 2.2. The next release will have it upgraded to the latest 
> version, but I’m hoping to identify the cause before then. Has anybody else 
> seen anything like this?
> 
> Here is the relevant part of the config:
> 
> <RollingFile  name="mainLog"  fileName="logs/logfile.log"  
> filePattern="logs/logfile-%d{yyyy-MM-dd}_%i.log"  append="true">
>                <PatternLayout  pattern="%date{yyyy-MM-dd HH:mm:ss.SSS}, 
> [%thread], %-5level, %logger{1}, - %message%n" />
>                <Policies>
>                                <TimeBasedTriggeringPolicy />
>                                <SizeBasedTriggeringPolicy size="200 MB"/>
>                </Policies>
>                <DefaultRolloverStrategy max="15" /> </RollingFile>
> 
> Thank you.
> Charl
> 
> 
> 
> NOTICE: The foregoing message contains confidential information (including 
> attachments) intended only for the use of the addressee(s) named above. If 
> you are not the addressee, or the person responsible for delivering it to the 
> addressee, you are hereby notified that reading, disseminating, distributing, 
> printing, or copying this message is strictly prohibited. If you have 
> received this message in error, please notify us by replying to the message 
> immediately. Please also proceed to delete the original message directly 
> following your reply.   Not responsible for typographical errors.  Prices 
> subject to change without notice.  Prices for backordered product are not 
> guaranteed.   If you do not wish to receive future promotional announcements, 
> please reply to this email with "Remove" as your subject.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to