NestJS Logging

Learn about integrating Sentry with NestJS logging.

To integrate Sentry logs in your NestJS application, follow the general logs setup guide.

The default NestJS logger uses console.log under the hood. If you're using the default logger, you can use the consoleLoggingIntegration to capture console logs.

Note that this only works if you set the forceConsole option in the logger:

Copied
const app = await NestFactory.create(AppModule, {
  logger: new ConsoleLogger({
    forceConsole: true,
  }),
});
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").