Atatus Node.js APM Agent extends your application’s logging capabilities with automatic log capture and correlation, allowing you to connect logs, traces, and transactions for easier debugging and deeper observability. These features help you:
  • Automatically capture logs from supported libraries and forward them to Atatus.
  • Correlate captured logs with the active trace, transaction, and span context.
  • Navigate from any log entry to its corresponding trace in the Atatus dashboard, with no manual ID injection required.

Log Correlation

When log capture is enabled, the Atatus Node.js Agent automatically attaches the active trace context to every captured log event: These identifiers are added to the log event by the agent itself, so you don’t need to modify your log format or inject IDs into your log messages.

Enabling Log Capture

Log capture is disabled by default. To enable it, set the following environment variable before starting your Node.js application:
Once enabled, the agent automatically instruments supported logging libraries, with no code changes required.

Supported Logging Libraries

The Atatus Node.js Agent automatically captures logs from the following libraries when ATATUS_CAPTURE_LOGS is set to true:
  • console: built-in console.log, console.info, console.warn, console.error, and console.debug calls
  • winston: version 3.x and above
No additional packages, formatters, or transports are required. As soon as the agent is initialized and ATATUS_CAPTURE_LOGS=true is set, log calls made within an active transaction are captured and correlated with the trace context automatically.

console Example

winston Example

Excluding Specific Libraries

If you want log capture enabled in general but need to exclude one of the supported libraries, use the ATATUS_EXCLUDE_LOG_LIBRARIES environment variable. Pass a comma-separated list of library names to skip:
Valid values are console and winston.