Skip to main content
Version: 3.2.0

feat-json-logs

✨ New Features​

[Opt-in JSON log lines]​

Goal: Collectors such as Datadog index a line when the whole line is one JSON object. The text line stays the default for everyone else.

Solution: /config/settings.yaml logger.format is text (default) or json, read at process start with the other logger settings. Text lines print operator labels as key=value. JSON lines use status, ISO timestamp, root labels, and nested data. Nest bootstrap and the process catch go through the same logger.

Features:

  • format: json switches stdout and /data/log together
  • Text extraFields are env=prod site=plant-42, quoted when the value has a space or =
  • Missing or unknown format keeps the historical text line

Files Modified:

  • src/core/logger/ - format switch, logfmt labels, JSON line, Winston output test
  • src/main.ts - NestFactory and bootstrap failure use LoggerService
  • docs/user/operations/custom-logging.md - EN / FR