Files
ccs/src/services/logging/index.ts
T
Tam Nhu Tran 7a22e89046 feat(logging): add structured contract, ALS context, stage helpers, and redaction coverage
Establish the structured-log foundation that downstream modules consume:
- LogStage union (intake|route|auth|dispatch|upstream|transform|respond|cleanup)
- AsyncLocalStorage-backed log-context for end-to-end requestId propagation
- Logger.stage() emit helper with optional latencyMs and structured metadata
- Extended log-redaction patterns for proxy-authorization, x-goog-api-key,
  oauth-code, refresh-token classes; Bearer/Basic/Token value-shape masking
- Public exports: getRecentLogEntries, withRequestContext, runWithRequestId,
  getRequestId

Refs #1141, #1138
2026-04-30 12:59:42 -04:00

38 lines
1021 B
TypeScript

export { createLogger } from './logger';
export type { Logger, StageOptions } from './logger';
export { getResolvedLoggingConfig, invalidateLoggingConfigCache } from './log-config';
export { readLogEntries, readLogSourceSummaries, normalizeLogQueryLevel } from './log-reader';
export { pruneExpiredLogArchives } from './log-storage';
export {
ensureLoggingDirectories,
getCurrentLogPath,
getLegacyCliproxyLogsDir,
getLogArchiveDir,
getNativeLogsDir,
isPathInsideDirectory,
} from './log-paths';
export { getRecentLogEntries, clearRecentLogEntries } from './log-buffer';
export {
withRequestContext,
runWithRequestId,
getRequestContext,
getRequestId,
mergeRequestContext,
} from './log-context';
export type { RequestContext } from './log-context';
export {
LOG_LEVELS,
LOG_STAGES,
shouldWriteLogLevel,
isLoggingLevel,
isLogStage,
} from './log-types';
export type {
LogEntry,
LogErrorInfo,
LogSourceSummary,
LogStage,
LoggingLevel,
ReadLogEntriesOptions,
} from './log-types';