2.7.2 • Published 12 months ago

trubudget-logging-service v2.7.2

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
12 months ago

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

2.7.0

1 year ago

2.7.2

12 months ago

2.7.1

1 year ago

2.6.0

1 year ago

1.2.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago