-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFOS stop logging after some time #70
Comments
Hello @petemm123! Thanks so much for your kind words! ❤️ Mind helping me with the following questions, please?
|
Hello @vy , thanks, config is de facto copied from some example (in fact paths and size is from parameters - I've replaced it with constants here)
Everything worked ok but after some time (few days or few hours, last time it was 19th rotation, previously 90+th rotation), zero length app.log appeared and in log, there was an error that (I'm not sure exactly) rfos cannot write to closed stream. Note that many threads share one rfos, so approx 1-2 lines per second are written. So I've bounded rfos.write with try-catch block and when message contain "losed" (both "closed" and "Closed"), new rfos with same config is initialized As logging is set to debug, these lines appear in log: triggering {byteCount=2428461623}\n","stream":"stdout","time":"2022-02-23T05:34:56.180176085Z"} and /tmp/abc/app.log is still 0 byte size. You will understand this better. Sorry I don't have LoggingRotationCallback in place but if I should, I can put it there and log anything and share with you, please just write me how to put this in place and what to do/log. Thanks a lot! MM |
Which
What do you exactly mean by it didn't help? Would you also share the stack trace of the error you have mentioned? Do you also have a thread dump for me when you are writing but nothing gets either written or rotated? Would you also share some more DEBUG logs from |
Hi, version: OS version, JDK, etc. - it is docker, namely "FROM tomcat:9.0-jdk17-openjdk-buster" try - catch & "didn't help" - from some time, stream became closed and new file has zero size. I've tried to try-catch block and when it gets "closed" error, I've tried to reopen ( if (rfos!=null &!this.locked) the log - these 3 lines in log repeats every time I try to write to file and it seems that this is the only what I get from log when rfos is not writing to file (debug log rotates quickly so I haven;t catched the moment it stopped writing) If you suggest how, I will log any information received throught callback and can send it to you. But I need what I should log. Thanks a lot! |
Maybe one more thing - if you suggest how to "restore" operation, e.g. when I find the stream closed but rfos not null - how to release the file and "restart" (reinitialize) rfos, it would be solution for me. Having not null rfos and reinitializing by |
Thanks for the prompt and elaborate responses, @petrmasa.
|
@vy Thanks a lot for solution proposal. I'll ask colleagues to encorporate these sources (I'm not sure how but they will). Where I see potential source of the problem:
My opinion is that on error I should somehow close/destroy original file handles before initializing new one. But this is only idea. Thanks a lot! |
I don't think this can happen, since I will try to put together something for your reopen-on-I/O-error case. Though as you might imagine, I want to get RFOS fixed first rather than handing users workarounds. |
Hi @vy thanks for code, sorry for late answer, we tried this code and unfortunately the problem still persists. Note that we observed that it became stuck at 1:00:00 AM GMT+1 in all cases (app.log file timestamp) that is 0:00:00 GMT+0. Sometimes it did rotation of old file even it was between 5-6MB, very small or even zero size and rotation was set to 10MB (we observed it several times). Can this fact play a role? Information from past: Feb 10 started over, worked fine till Feb 17 1:00 (last rotated file - i.e. file with date and time in its name is approx 5-6MB) and app.log zero length And then, all files (compressed/uncompressed) at 1:00 typically rotates file which is empty (maybe it somehow resets the file and content). Maybe it will help. Note we also looked at scheduled tasks like system backup and it takes absolutely different timeslots. Thanks a lot MM |
You are telling me that, using the 0.9.5-SNAPSHOT version, you still observe zero-length file rotations. That is, there are stream.flush();
if (readFileLength() == 0) {
LOGGER.debug("empty file, skipping rotation {file={}}", config.getFile());
return;
} This clearly indicates we are not able obtain the correct file length from the file system properly. @petrmasa, shall we have a video call where I can get the picture better? If so, would you mind emailing me which of the following time slots suit you best, please: next Monday, Tuesday, Wednesday, or Thursday at 10:00 CET. |
Thanks a lot, we've tried to look what is triggering daily rotation (made many debug logs inside) and probably found the reason
We've either copypasted example or maybe colleague ment rotate daily or by size what comes earlier so we had two rotation policies in place. Now we have it in testing and seems to work ok (for last 2 nigths). Thanks a lot, |
I hope the problem is resolved for you. If you still experience issues, let's try to arrange a video call as I have indicated earlier.
No, it cannot. They operate in exclusive blocks, any number of rotation policies can (and should!) coexist. Mind closing the ticket if you don't have issues anymore, please? |
Thanks a lot! Currently it is working, if something happens I'll let you know. Thanks a lot for your support. |
Thanks a lot for your support! |
Your library is great. I have one issue - after some time, no information is written to log, actual file is zero size, rotation trigger is invoked but it skips rotation and writes nothing.
It is size based policy, number (bytecount) is increasing after every attempt to write but nothing is written into file (attempt to reopen file was made but it does not help).
Two notes:
Please could you suggest solution? I believe that your library is superb, this is minor bug (but for me important).
Thanks,
MM
The text was updated successfully, but these errors were encountered: