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

nestjs-serilog-like-logger

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-serilog-like-logger

This logger for NestJS is designed to provide a logging experience similar to Serilog, with a format and style inspired by NestJS's built-in `console-logger.service.ts` and the Serilog logging framework. It supports various log levels and outputs structur

  • 1.0.0-alpha.2
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

NestJS Serilog-Like Logger

This logger for NestJS is designed to provide a logging experience similar to Serilog, with a format and style inspired by NestJS's built-in console-logger.service.ts and the Serilog logging framework. It supports various log levels and outputs structured logs in a clear, readable format.

Features

  • Log levels based on Serilog's structure, providing a range of verbosity from Verbose to Fatal.
  • Integration with NestJS, allowing for seamless use within any NestJS application.
  • Structured logging, providing detailed context and service information.

Output Example

The logger outputs JSON formatted logs. An example log entry might look like this:

{"Level":"Information","Message":"Starting Nest application...","Timestamp":"2023-12-06T22:36:10.672Z","Service":"demo-api-service","SourceContext":"NestFactory"}

Installation

To install the nestjs-serilog-like-logger, run:

npm install nestjs-serilog-like-logger

or

yarn add nestjs-serilog-like-logger

Usage

To use the logger in your NestJS application:

import { NestjsSerilogLikeLogger } from 'nestjs-serilog-like-logger';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule, {
    logger: new NestjsSerilogLikeLogger('demo-api-service'),
  });

  await app.listen(3000);
}

bootstrap();

This will configure your NestJS application to use the NestjsSerilogLikeLogger for all its logging needs.

Log Event Levels

The logger supports the following log event levels, inspired by Serilog:

  • Verbose: Detailed information about the flow through the system.
  • Debug: Information useful for debugging.
  • Information: General operational entries about what's happening inside the application.
  • Warning: Indications of possible issues or service degradation.
  • Error: Errors and exceptions that cannot be handled.
  • Fatal: Critical errors causing complete failure of the application.

Contributing

Contributions to the nestjs-serilog-like-logger are welcome. Please submit any issues or pull requests through the project's GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs

Package last updated on 13 Dec 2023

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