New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@maeum/logging-controller

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maeum/logging-controller

maeum logging controller

latest
Source
npmnpm
Version
2.2.0
Version published
Maintainers
1
Created
Source

logging controller

ts Download Status Github Star Github Issues NPM version @maeum/i18n-controller License codecov code style: prettier

The @maeum/logging-controller is an implementation of best practices for handling logging in the fastify.js framework. It allows you to pick and choose which logging framework you want to use between winston and pino, and provides standard guidelines when you don't know what to log. It also provides methods for logging richer logs. For example, it takes extra work to include the payload from a FastifyReply to a client in the log, but in @maeum/logging-controller all I need to do is tell it I want to log it. Use @maeum/logging-controller to log richer, easier logs!

Why use @maeum/logging-controller?

  • You can choose your favorite package between winston and pino
  • Convert FastifyRequest to curl so you can quickly reproduce problems when they occur
  • You can logging the payload of a reply object
  • When logging the payload of a reply object, you can compress it with snappy

Getting Started

installation

npm install @maeum/logging-controller --save

Configuration

import { pino as pinoBootstrap, RequestLogger } from '@maeum/logging-controller';

// bootstrap pino logger
pinoBootstrap(false);

const server = fastify()

// pino logger add in fastify by plugin
server.register(RequestLogger.it.plugin, RequestLogger.it);

How to work?

The @maeum/logging-controller consists of various functions, including functions to initialize winston and pino, functions to extract information for logging from FastifyRequest, and functions to generate curl commands. These functions make it easy for developers to log detailed information while also allowing them to customize the information needed for logging.

flowchart LR
    FR[FastifyRequest]
    FP[FastifyReply]
    WL[winston]
    RL[Request<br />Logger]
    CC[curl<br />command<br />creator]

    subgraph FF[Fastify]
        direction TB
        FR
        FP
        FR --- FP
    end

    FF-->RL
    FF-->CC
    RL-->WL
    CC-->WL

Keywords

maeum

FAQs

Package last updated on 08 Jun 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