Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-19876] Store custom log contents to disk.
- Loading branch information
Showing
1 changed file
with
90 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2deeb5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephenc any comments on this?
2deeb5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely have a negative performance impact as it is flushing ALL logs to disk all the time
2deeb5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it flushes after writing a record. This would be a problem if you have some logger which is receiving a heavy stream of messages, which can happen (though usually not intentionally). On the other hand I do not want to lose records if Jenkins crashes. Perhaps flushing every fifteen seconds (if anything has been written) would be a decent compromise?
2deeb5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a memory mapped file as the write destination might be best. That way you are letting the OS handle the persist and looping around is easier too
2deeb5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I cannot use
ReopenableFileOutputStream
however.I filed JENKINS-21029 as a reminder.