Skip to main content
Version: 3.2.0

Opt-in JSON log lines

Overview​

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

How it works​

/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.

Key files​

  • 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

Known issues​

  • None recorded in the 3.2.0 fragment.

Next steps​

  • None from this release.