Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-pino

Package Overview
Dependencies
Maintainers
1
Versions
1330
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-pino

Pino logger for NestJS

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
532K
increased by2.51%
Maintainers
1
Weekly downloads
 
Created

What is nestjs-pino?

The `nestjs-pino` package is a logging module for NestJS applications that integrates the Pino logger. Pino is a fast, low-overhead logging library for Node.js. This package allows you to leverage Pino's performance and features within a NestJS application.

What are nestjs-pino's main functionalities?

Basic Logging

This feature allows you to set up basic logging in a NestJS application using Pino. The `LoggerModule.forRoot` method configures the logger with the specified options.

const { LoggerModule } = require('nestjs-pino');

@Module({
  imports: [
    LoggerModule.forRoot({
      pinoHttp: { level: 'info' }
    })
  ]
})
export class AppModule {}

Request Logging

This feature enables logging of HTTP requests. The `pinoHttp` option allows you to configure the logging level and other settings for HTTP request logging.

const { LoggerModule } = require('nestjs-pino');

@Module({
  imports: [
    LoggerModule.forRoot({
      pinoHttp: { level: 'info', prettyPrint: true }
    })
  ]
})
export class AppModule {}

Custom Logger Configuration

This feature allows you to provide a custom configuration for the logger using a factory function. This is useful for dynamic configuration based on environment variables or other runtime conditions.

const { LoggerModule } = require('nestjs-pino');

@Module({
  imports: [
    LoggerModule.forRootAsync({
      useFactory: () => ({
        pinoHttp: { level: 'debug', prettyPrint: true }
      })
    })
  ]
})
export class AppModule {}

Other packages similar to nestjs-pino

Keywords

FAQs

Package last updated on 16 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc