diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx index 10ff8ff4d5928b..aa9b714dfd2f2e 100644 --- a/docs/platforms/javascript/common/logs/index.mdx +++ b/docs/platforms/javascript/common/logs/index.mdx @@ -165,6 +165,73 @@ console.log("Executed Action for User:", 123, true); + + + + +## Logging Library Integrations + + + + + + +### Pino + +Send logs from the [Pino](https://github.com/pinojs/pino) logging library to Sentry. + +Requires SDK version `10.18.0` or higher. + + + + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + enableLogs: true, + integrations: [Sentry.pinoIntegration()], +}); +``` + +See Pino integration docs for configuration options. + + + + + + + +### Winston + +Send logs from the [Winston](https://github.com/winstonjs/winston) logging library to Sentry. + +Requires SDK version `9.13.0` or higher and `enableLogs: true` in your `Sentry.init` call. + + + + +```javascript +import winston from "winston"; +import Transport from "winston-transport"; + +const SentryTransport = Sentry.createSentryWinstonTransport(Transport, { + levels: ["error", "warn"], // optional filter +}); + +const logger = winston.createLogger({ + transports: [new SentryTransport()], +}); +``` + + + + + + + + + +