- 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:Supported Logging Libraries
The Atatus Node.js Agent automatically captures logs from the following libraries whenATATUS_CAPTURE_LOGS is set to true:
console: built-inconsole.log,console.info,console.warn,console.error, andconsole.debugcallswinston: version3.xand above
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 theATATUS_EXCLUDE_LOG_LIBRARIES environment variable. Pass a comma-separated list of library names to skip:
console and winston.