Package io.github.connellite.logger
Record Class FileLogHandlerConfig
java.lang.Object
java.lang.Record
io.github.connellite.logger.FileLogHandlerConfig
public record FileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, boolean compressRotatedGzip, Formatter formatter)
extends Record
Settings for
FileLogHandler: buffer size, optional rotation (by size and/or calendar day), and log line format.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FileLogHandlerConfigBuffered writes, no rotation,SimpleFormatter. -
Constructor Summary
ConstructorsConstructorDescriptionFileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, boolean compressRotatedGzip, Formatter formatter) Creates an instance of aFileLogHandlerConfigrecord class.FileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, Formatter formatter) -
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.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.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) withRotateDaily(boolean daily)
-
Field Details
-
DEFAULT
Buffered writes, no rotation,SimpleFormatter.
-
-
Constructor Details
-
FileLogHandlerConfig
public FileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, boolean compressRotatedGzip, Formatter formatter) Creates an instance of aFileLogHandlerConfigrecord 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 component
-
FileLogHandlerConfig
public FileLogHandlerConfig(int bufferSize, long maxFileBytes, boolean rotateDaily, int maxBackupFiles, Formatter formatter)
-
-
Method Details
-
withBufferSize
-
withMaxFileBytes
-
withRotateDaily
-
withMaxBackupFiles
-
withCompressRotatedGzip
-
withFormatter
-
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
-