Package io.github.connellite.logger
Class BufferedFileLogHandler
java.lang.Object
java.util.logging.Handler
io.github.connellite.logger.BufferedFileLogHandler
Deprecated.
Handler that keeps formatted lines in a byte buffer and opens the log file only to drain that buffer.
A drain runs from flush(), from close(), and when the buffer reaches
FileLogHandlerConfig.bufferSize().
Optional rotation uses the same rules as FileLogHandler: size, calendar day, backup count, and gzip.
publish(java.util.logging.LogRecord), flush(), and close() hold lock. The file is not left open after a drain.
close() drains the buffer, appends the formatter tail when this instance wrote the current segment, then
ignores later records.
-
Constructor Summary
ConstructorsConstructorDescriptionBufferedFileLogHandler(Path logFile) Deprecated.BufferedFileLogHandler(Path logFile, FileLogHandlerConfig config) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.Drains the buffer, appends the formatter tail when this instance wrote the current segment, then ignores later records.voidflush()Deprecated.Drains the buffer into the log file.voidDeprecated.Formats the record and appends it to the buffer.Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Constructor Details
-
BufferedFileLogHandler
Deprecated. -
BufferedFileLogHandler
Deprecated.
-
-
Method Details
-
publish
Deprecated.Formats the record and appends it to the buffer. The file is opened only when the buffer reachesFileLogHandlerConfig.bufferSize(). Formatting runs before the lock, so a formatter failure does not drain or rotate. -
flush
public void flush()Deprecated.Drains the buffer into the log file. Does nothing when the buffer is empty or this handler is already closed. -
close
public void close()Deprecated.Drains the buffer, appends the formatter tail when this instance wrote the current segment, then ignores later records.
-
FileLogHandler.