New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nest-winston

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nest-winston

A Nest module wrapper for winston

  • 1.10.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
408K
decreased by-21.95%
Maintainers
1
Weekly downloads
 
Created

What is nest-winston?

The nest-winston package is a logging module for NestJS applications that integrates the popular Winston logger. It allows developers to leverage Winston's powerful logging capabilities within the NestJS framework, providing a flexible and configurable logging solution.

What are nest-winston's main functionalities?

Basic Logging

This feature allows you to set up basic logging in a NestJS application using Winston. The example shows how to create a logger with a console transport.

const { WinstonModule } = require('nest-winston');
const winston = require('winston');

const app = await NestFactory.create(AppModule, {
  logger: WinstonModule.createLogger({
    transports: [
      new winston.transports.Console(),
    ],
  }),
});

Custom Transports

This feature allows you to configure custom transports for logging. The example demonstrates how to add file and HTTP transports to the logger.

const { WinstonModule } = require('nest-winston');
const winston = require('winston');

const app = await NestFactory.create(AppModule, {
  logger: WinstonModule.createLogger({
    transports: [
      new winston.transports.File({ filename: 'combined.log' }),
      new winston.transports.Http({ host: 'localhost', port: 3000 }),
    ],
  }),
});

Log Formatting

This feature allows you to customize the format of the log messages. The example shows how to combine timestamp and JSON formatting for the logs.

const { WinstonModule } = require('nest-winston');
const winston = require('winston');

const app = await NestFactory.create(AppModule, {
  logger: WinstonModule.createLogger({
    format: winston.format.combine(
      winston.format.timestamp(),
      winston.format.json()
    ),
    transports: [
      new winston.transports.Console(),
    ],
  }),
});

Other packages similar to nest-winston

Keywords

FAQs

Package last updated on 21 Jan 2025

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