export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
export interface LogEntry {
    timestamp: string;
    level: LogLevel;
    sessionId: string;
    component: string;
    message: string;
    data?: any;
    duration?: number;
    error?: {
        name: string;
        message: string;
        stack?: string;
    };
}
export interface LogQuery {
    sessionId?: string;
    level?: LogLevel | LogLevel[];
    component?: string;
    startTime?: Date;
    endTime?: Date;
    limit?: number;
    search?: string;
}
export interface SessionLogSummary {
    sessionId: string;
    startTime: string;
    endTime?: string;
    logCount: number;
    errorCount: number;
    warnCount: number;
    components: string[];
    traceId?: string;
    query?: string;
}
export declare function sanitizeLogData(data: any): any;
export declare class SessionLogger {
    private logDir;
    private sessionId;
    private logFile;
    private logCount;
    private metadata;
    private startTime;
    constructor(sessionId: string, logDir?: string);
    /**
     * Set session metadata (traceId, query, etc.)
     */
    setMetadata(metadata: Record<string, any>): void;
    /**
     * Log a debug message
     */
    debug(component: string, message: string, data?: any): void;
    /**
     * Log an info message
     */
    info(component: string, message: string, data?: any): void;
    /**
     * Log a warning message
     */
    warn(component: string, message: string, data?: any): void;
    /**
     * Log an error message
     */
    error(component: string, message: string, error?: Error | any, data?: any): void;
    /**
     * Log with timing (for performance tracking)
     */
    timed<T>(component: string, operation: string, fn: () => T): T;
    /**
     * Core log method
     */
    private log;
    /**
     * Write entry to log file
     */
    private writeEntry;
    /**
     * Read all logs for this session
     */
    readLogs(): LogEntry[];
    /**
     * Get session summary
     */
    getSummary(): SessionLogSummary;
    /**
     * Get the log file path
     */
    getLogFilePath(): string;
    /**
     * Close the session (write end marker)
     */
    close(): void;
}
declare class SessionLoggerManager {
    private logDir;
    private loggers;
    constructor(logDir?: string);
    /**
     * Get or create a logger for a session
     */
    getLogger(sessionId: string): SessionLogger;
    /**
     * Close and remove a logger
     */
    closeLogger(sessionId: string): void;
    /**
     * List all session log files
     */
    listSessions(): SessionLogSummary[];
    /**
     * Read logs for a specific session
     */
    readSessionLogs(sessionId: string, query?: Partial<LogQuery>): LogEntry[];
    /**
     * Filter logs based on query
     */
    private filterLogs;
    /**
     * Clean up old log files
     */
    cleanup(maxAgeMs?: number): number;
    /**
     * Get the log directory path
     */
    getLogDir(): string;
}
export declare function getSessionLoggerManager(): SessionLoggerManager;
export declare function createSessionLogger(sessionId: string): SessionLogger;
import { Request, Response, NextFunction } from 'express';
/**
 * Express middleware for request logging
 */
export declare function requestLoggingMiddleware(sessionIdExtractor: (req: Request) => string | undefined): (req: Request, res: Response, next: NextFunction) => void;
declare const _default: {
    SessionLogger: typeof SessionLogger;
    SessionLoggerManager: typeof SessionLoggerManager;
    getSessionLoggerManager: typeof getSessionLoggerManager;
    createSessionLogger: typeof createSessionLogger;
    requestLoggingMiddleware: typeof requestLoggingMiddleware;
};
export default _default;
//# sourceMappingURL=sessionLogger.d.ts.map