// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import pino from 'pino';

import { getCorrelationId } from './correlation-context.js';
import { resolveLogTransport } from './log-transport.js';
import { REDACT_PATHS } from './sanitizer.js';

/** Structured JSON logger with automatic secret redaction and traceId
 * correlation — REQ-2.3.1. */
export const logger = pino({
  level: process.env['{{ tool_prefix_env }}_LOG_LEVEL'] ?? 'info',
  redact: { paths: REDACT_PATHS, censor: '[REDACTED]' },
  mixin() {
    const traceId = getCorrelationId();
    return traceId ? { traceId } : {};
  },
  transport: resolveLogTransport(),
});
