From f8515ec28b0448da3e1963646235c9170679966b Mon Sep 17 00:00:00 2001 From: simon-id Date: Wed, 16 Oct 2024 17:18:17 +0200 Subject: [PATCH] Remove old debug option from docs (#4786) --- docs/API.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/API.md b/docs/API.md index e68ba3cac0e..19827e5977d 100644 --- a/docs/API.md +++ b/docs/API.md @@ -381,7 +381,7 @@ Options can be configured as a parameter to the [init()](./interfaces/tracer.htm

Custom Logging

-By default, logging from this library is disabled. In order to get debugging information and errors sent to logs, the `debug` options should be set to `true` in the [init()](./interfaces/tracer.html#init) method. +By default, logging from this library is disabled. In order to get debugging information and errors sent to logs, the `DD_TRACE_DEBUG` env var should be set to `true`. The tracer will then log debug information to `console.log()` and errors to `console.error()`. This behavior can be changed by passing a custom logger to the tracer. The logger should contain a `debug()` and `error()` methods that can handle messages and errors, respectively. @@ -394,14 +394,15 @@ const logger = bunyan.createLogger({ level: 'trace' }) +process.env.DD_TRACE_DEBUG = 'true' + const tracer = require('dd-trace').init({ logger: { error: err => logger.error(err), warn: message => logger.warn(message), info: message => logger.info(message), debug: message => logger.trace(message), - }, - debug: true + } }) ```