FileSize

class FileSize(val folder: String = getDefaultLogFolder(), val fileBaseName: String = DEFAULT_FILE_BASE_NAME, val fileExtension: String = DEFAULT_FILE_EXTENSION, filesToKeep: Int = DEFAULT_FILES_TO_KEEP, maxFileSizeInBytes: Int = DEFAULT_MAX_FILE_SIZE_IN_BYTES) : FileLoggerSetup

Writes all logs to a single active file.

When the file reaches maxFileSizeInBytes, it is archived and a new active file is created. Keeps only the newest filesToKeep log files (including the active file).

Defaults:

  • fileBaseName = "log"

  • fileExtension = "txt"

  • filesToKeep = 5

  • maxFileSizeInBytes = 5 MB

Constructors

Link copied to clipboard
constructor(folder: String = getDefaultLogFolder(), fileBaseName: String = DEFAULT_FILE_BASE_NAME, fileExtension: String = DEFAULT_FILE_EXTENSION, filesToKeep: Int = DEFAULT_FILES_TO_KEEP, maxFileSizeInBytes: Int = DEFAULT_MAX_FILE_SIZE_IN_BYTES)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val fileBaseName: String
Link copied to clipboard
open override val fileConverter: FileConverter
Link copied to clipboard
open override val fileExtension: String
Link copied to clipboard
open override val folder: String

Functions

Link copied to clipboard
open suspend override fun deleteAllLogFiles()
Link copied to clipboard
open override fun filterFilesToDelete(files: List<Path>): List<Path>
Link copied to clipboard
open override fun getActiveLogFilePath(event: FileLogger.Event.Log): Path
Link copied to clipboard
open override fun getAllExistingLogFilePaths(): List<Path>
Link copied to clipboard
open override fun getAllLogFiles(sorted: Boolean): List<Path>
Link copied to clipboard
open override fun getLatestLogFilePath(): Path?
Link copied to clipboard
open override fun getRollOverType(currentPath: Path?, event: FileLogger.Event.Log): BaseFileLoggerSetup.RollOverType