import LoggerStorageRepositoryInterface from './LoggerStorageRepositoryInterface'; export default class LoggerFileRepository implements LoggerStorageRepositoryInterface { private loggingConfig; /** * Constructor */ constructor(loggingConfig: any); /** * Log debug message */ debug(message: string, params: any, channel: string | undefined): void; /** * Log info message */ info(message: string, params: any, channel: string | undefined): void; /** * Log warning message */ warning(message: string, params: any, channel: string | undefined): void; /** * Log error message */ error(message: string, params: any, channel: string | undefined): void; /** * Log critical message */ critical(message: string, params: any, channel: string | undefined): void; /** * Creates log files directory if needed */ private createLogFilesDirectoryIfItDoesNotExists; /** * Get current log file path */ private getLogFilePath; /** * Throws exception if channel does not exists */ private throwExceptionIfChannelDoesNotExists; /** * Compose and return a pretty string for logger (b&w) */ private makePrettyStringNoColor; /** * Run all rotation phases in order */ private rotateLogFiles; /** * Phase 1: Rotate active log files that exceed maxFileSizeMb * Active file is renamed with a numeric suffix and compressed, * a new empty file will be created automatically on next write */ private rotateOversizedActiveFiles; /** * Phase 2: Compress old .log files * Files older than compressAfterDays are gzip compressed * Numbered chunks (e.g. sosise-2026-03-17.1.log) are compressed immediately regardless of age */ private compressOldLogFiles; /** * Phase 3: Delete files older than maxAgeDays */ private deleteExpiredFiles; /** * Phase 4: Enforce max total directory size * Delete oldest files first until total size is under limit * Active log files are NEVER deleted */ private enforceMaxTotalSize; /** * Compress a file with gzip and delete the original */ private compressFile; /** * Parse a log file name into its components * Returns null if file name doesn't match the expected pattern */ private parseLogFileName; /** * Check if a file is an active log file * Active = today's date, no numeric counter, not compressed (.log extension) */ private isActiveLogFile; /** * Get the next available counter for a rotated file * E.g. if sosise-2026-03-17.1.log.gz exists, returns 2 */ private getNextCounter; /** * Get all log files from the log directory with their metadata * Only returns files matching the log file pattern (ignores .gitignore, etc.) */ private getLogDirectoryFiles; /** * Schedule periodic rotation check */ private schedulePeriodicRotation; }