/**
 * Logger Service
 * Provides centralized logging with rotation, compression, and management
 */
import { Logger as WinstonLogger } from "winston";
import { ReadStream } from "fs";
import type { Request, Response } from "express";
interface LoggerOptions {
    level?: string;
    console?: boolean;
    file?: boolean;
    maxSize?: string;
    maxFiles?: string;
    compress?: boolean;
}
interface LogStats {
    totalSize: number;
    fileCount: number;
    files: LogFileInfo[];
    oldestLog?: Date;
    newestLog?: Date;
    archivedCount?: number;
}
interface LogFileInfo {
    name: string;
    size: number;
    modified: Date;
    compressed: boolean;
}
export interface ExtendedWinstonLogger extends WinstonLogger {
    logRequest?: (req: Request, res: Response, duration: number) => void;
    logSimulator?: (simulatorId: string, action: string, data?: any) => void;
    logError?: (error: Error, context?: any) => void;
    compactLogs?: (daysToKeep?: number) => Promise<LogStats>;
    getLogStats?: () => Promise<LogStats>;
}
declare class Logger {
    private logsDir;
    private archiveDir;
    private loggers;
    private initialized;
    private messageQueue;
    private initPromise?;
    constructor();
    initialize(options?: {
        appName?: string;
        logLevel?: string;
        consoleOutput?: boolean;
        fileOutput?: boolean;
        logsDir?: string;
    }): Promise<void>;
    private _doInitialize;
    private processMessageQueue;
    isInitialized(): boolean;
    /**
     * Get recent log entries from memory or file
     */
    getRecentLogs(limit?: number, level?: string): Promise<any[]>;
    /**
     * Clear all log files
     */
    clearLogs(): Promise<void>;
    child(name: string): any;
    private ensureDirectories;
    /**
     * Clean up subdirectories to maintain flat structure
     */
    private cleanupSubdirectories;
    private cleanupOldLogs;
    createLogger(category?: string, options?: LoggerOptions): ExtendedWinstonLogger;
    getLogStats(): Promise<LogStats>;
    archiveLogs(olderThanDays?: number): Promise<void>;
    downloadLogFile(filename: string): Promise<ReadStream | null>;
    /**
     * Compact logs by archiving old files
     */
    compactLogs(daysToKeep?: number): Promise<LogStats>;
    /**
     * Clean up zero-length files and corrupted archives
     */
    cleanupZeroFiles(): Promise<{
        removed: number;
    }>;
    /**
     * Purge all logs (dangerous operation)
     */
    purgeAllLogs(): Promise<void>;
    /**
     * Export logs in various formats
     */
    exportLogs(options?: {
        level?: string;
        format?: "txt" | "json" | "csv";
        startDate?: Date;
        endDate?: Date;
    }): Promise<string>;
    /**
     * Get list of all log files including archives
     */
    getAllLogFiles(): Promise<LogFileInfo[]>;
    /**
     * Get all logger instances (for rotation)
     */
    getLoggers(): Map<string, ExtendedWinstonLogger>;
}
declare const logger: Logger;
export declare function createLogger(name?: string): any;
export declare function initializeLogger(options?: any): Promise<void>;
export declare function configureLogging(options?: any): void;
export declare function getLogStats(): Promise<LogStats>;
export declare function archiveLogs(olderThanDays?: number): Promise<void>;
export declare function downloadLogFile(filename: string): Promise<ReadStream | null>;
export declare function getRecentLogs(limit?: number, level?: string): Promise<any[]>;
export declare function clearLogs(): Promise<void>;
export default logger;
export { logger as getLogger };
//# sourceMappingURL=logger.d.ts.map