Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

trubudget-logging-service

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trubudget-logging-service

This is module exports function that creates a pino logger instance with a common configuration for the trubudget project

latest
Source
npmnpm
Version
2.7.2
Version published
Weekly downloads
88
66.04%
Maintainers
0
Weekly downloads
 
Created
Source

TruBudget Logging Config for Pino

This is module exports a pino logger instance with a common configuration for the TruBudget project

API

createPinoLogger(name)

Creates a Pino Logger instance that can be used to log messages. name will be passed on to pino to describe the name of the process which is logging messages

createPinoExpressLogger(pino, [options])

Creates a pino-http instance that can be used together with express pino should be a pino logger instance that can be created beforehand with createPinoLogger

options optional object containing additional setting, e.g. { "shortRoutesLogging": true }

  • silenceLoggingOnFrequentRoutes: (boolean) if set to true it will ignore logs in routes "/readiness", "/liveliness" and "/version".
  • shortRoutesLogging: (boolean) if set to true it will provide only shorter, one-line output for each HTTP call.

getLevel(level)

Takes a string that should be a loglevel (info, debug, error...) and makes sure it is a known log level. the validated string will be returned. If an invalid string is passed undefinedwill be returned

Pino Log Levels

These are the supported Log Levels:

  • trace
  • debug
  • info
  • warn
  • error
  • fatal

Information about when to use which level can be found here

FAQs

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