You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may appear very odd, but appenders like the RollingFileAppender may have a null output stream during rollover or even after if it failed to rotate the underlying file... I'm pretty sure the FileAppender will throw an exception before the DelegatingAsyncDisruptorAppender had a chance to flush at the end of the batch - so there is no point in checking for a null output stream. At least not until the FileAppender is "fixed" and can handle the null case gracefully...
The text was updated successfully, but these errors were encountered:
That's not what I meant... I should have say "... it seems there is no point in checking for a null output stream because it is likely an exception would be thrown earlier anyway...
The OutputStreamAppender#getOutputStream() doesn't say anything about whether it may or not return a null output stream. IMHO it would be safer to check for null anyway.
My example around the RollingFileAppender is from experience. The output stream can be null for a very short time during rollover (fair enough) - but it can stay null for longer when it fails to roll. In this case the appender is usually broken and won't be able to recover by itself.
The DelegatingAsyncDisruptorAppender may throw a NullPointerException at line https://github.com/logstash/logstash-logback-encoder/blob/master/src/main/java/net/logstash/logback/appender/DelegatingAsyncDisruptorAppender.java#L69 in the appender's output stream is
null
.This may appear very odd, but appenders like the RollingFileAppender may have a
null
output stream during rollover or even after if it failed to rotate the underlying file... I'm pretty sure the FileAppender will throw an exception before the DelegatingAsyncDisruptorAppender had a chance to flush at the end of the batch - so there is no point in checking for a null output stream. At least not until the FileAppender is "fixed" and can handle the null case gracefully...The text was updated successfully, but these errors were encountered: