import { getTraceId } from '@defra/hapi-tracing';
import { ecsFormat } from '@elastic/ecs-pino-format';
import { config } from "../../../../config/index.js";
const logConfig = config.get('log');
const serviceName = config.get('serviceName');
const serviceVersion = config.get('serviceVersion');
const formatters = {
  ecs: {
    ...ecsFormat(),
    base: {
      service: {
        name: serviceName,
        type: 'nodeJs',
        version: serviceVersion
      }
    }
  },
  'pino-pretty': {
    transport: {
      target: 'pino-pretty'
    }
  }
};
export const loggerOptions = {
  enabled: logConfig.enabled,
  ignorePaths: ['/health'],
  redact: {
    paths: logConfig.redact,
    remove: true
  },
  level: logConfig.level,
  ...formatters[logConfig.format],
  mixin() {
    const mixinValues = {};
    const traceId = getTraceId();
    if (traceId) {
      mixinValues.trace = {
        id: traceId
      };
    }
    return mixinValues;
  }
};
//# sourceMappingURL=logger-options.js.map