Package io.github.connellite.logger
Record Class AsyncFileLogHandlerConfig
java.lang.Object
java.lang.Record
io.github.connellite.logger.AsyncFileLogHandlerConfig
public record AsyncFileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, boolean compressRotatedGzip, Formatter formatter, int overflowDropType, int maxRecords)
extends Record
Settings for
AsyncFileLogHandler: everything FileLogHandlerConfig carries, plus the queue limit and
what to do when that queue is full.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AsyncFileLogHandlerConfigSame file settings asFileLogHandlerConfig.DEFAULT, drop-last overflow, queue of 10000.static final intOverflow policy: drop the current record.static final intOverflow policy: drop the first (oldest) record in the queue.static final intOverflow policy: wait until the queue accepts the record.static final intOverflow policy: drop the last record in the queue. -
Constructor Summary
ConstructorsConstructorDescriptionAsyncFileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, boolean compressRotatedGzip, Formatter formatter, int overflowDropType, int maxRecords) Creates an instance of aAsyncFileLogHandlerConfigrecord class.AsyncFileLogHandlerConfig(FileLogHandlerConfig fileConfig, int overflowDropType, int maxRecords) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebufferSizerecord component.booleanReturns the value of thecompressRotatedGziprecord component.final booleanIndicates whether some other object is "equal to" this one.File settings carried by this config, without the queue.Returns the value of theformatterrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxBackupFilesrecord component.longReturns the value of themaxFileBytesrecord component.intReturns the value of themaxRecordsrecord component.intReturns the value of theoverflowDropTyperecord component.booleanReturns the value of therotateDailyrecord component.final StringtoString()Returns a string representation of this record class.withBufferSize(int size) withCompressRotatedGzip(boolean compress) withFormatter(Formatter customFormatter) withMaxBackupFiles(int max) withMaxFileBytes(long bytes) withMaxRecords(int records) withOverflowDropType(int dropType) withRotateDaily(boolean daily)
-
Field Details
-
OVERFLOW_DROP_LAST
public static final int OVERFLOW_DROP_LASTOverflow policy: drop the last record in the queue.- See Also:
-
OVERFLOW_DROP_FIRST
public static final int OVERFLOW_DROP_FIRSTOverflow policy: drop the first (oldest) record in the queue.- See Also:
-
OVERFLOW_DROP_FLUSH
public static final int OVERFLOW_DROP_FLUSHOverflow policy: wait until the queue accepts the record.- See Also:
-
OVERFLOW_DROP_CURRENT
public static final int OVERFLOW_DROP_CURRENTOverflow policy: drop the current record.- See Also:
-
DEFAULT
Same file settings asFileLogHandlerConfig.DEFAULT, drop-last overflow, queue of 10000.
-
-
Constructor Details
-
AsyncFileLogHandlerConfig
public AsyncFileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, boolean compressRotatedGzip, Formatter formatter, int overflowDropType, int maxRecords) Creates an instance of aAsyncFileLogHandlerConfigrecord class.- Parameters:
bufferSize- the value for thebufferSizerecord componentmaxFileBytes- the value for themaxFileBytesrecord componentrotateDaily- the value for therotateDailyrecord componentmaxBackupFiles- the value for themaxBackupFilesrecord componentcompressRotatedGzip- the value for thecompressRotatedGziprecord componentformatter- the value for theformatterrecord componentoverflowDropType- the value for theoverflowDropTyperecord componentmaxRecords- the value for themaxRecordsrecord component
-
AsyncFileLogHandlerConfig
public AsyncFileLogHandlerConfig(FileLogHandlerConfig fileConfig, int overflowDropType, int maxRecords)
-
-
Method Details
-
fileLogHandlerConfig
File settings carried by this config, without the queue. -
withBufferSize
-
withMaxFileBytes
-
withRotateDaily
-
withMaxBackupFiles
-
withCompressRotatedGzip
-
withFormatter
-
withOverflowDropType
-
withMaxRecords
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
bufferSize
public int bufferSize()Returns the value of thebufferSizerecord component.- Returns:
- the value of the
bufferSizerecord component
-
maxFileBytes
public long maxFileBytes()Returns the value of themaxFileBytesrecord component.- Returns:
- the value of the
maxFileBytesrecord component
-
rotateDaily
public boolean rotateDaily()Returns the value of therotateDailyrecord component.- Returns:
- the value of the
rotateDailyrecord component
-
maxBackupFiles
public int maxBackupFiles()Returns the value of themaxBackupFilesrecord component.- Returns:
- the value of the
maxBackupFilesrecord component
-
compressRotatedGzip
public boolean compressRotatedGzip()Returns the value of thecompressRotatedGziprecord component.- Returns:
- the value of the
compressRotatedGziprecord component
-
formatter
Returns the value of theformatterrecord component.- Returns:
- the value of the
formatterrecord component
-
overflowDropType
public int overflowDropType()Returns the value of theoverflowDropTyperecord component.- Returns:
- the value of the
overflowDropTyperecord component
-
maxRecords
public int maxRecords()Returns the value of themaxRecordsrecord component.- Returns:
- the value of the
maxRecordsrecord component
-