Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

product-os/jellyfish-logger

Repository files navigation

Jellyfish Logger

The Jellyfish backend strongly discourages the use of console.log(). This module provides a set of functions that the backend uses for logging purposes.

Goals

  • The logger takes a request ID parameter to easily filter down logs that correspond to a single system request
  • The logger is able to log uncaught exceptions
  • The logger is able to send logs using different priority levels
  • The logger is able to preserve rich object logs
  • The logger is able to pipe logs to a central location when running in production

Usage

Below is an example how to use this library:

const logger = require('@balena/jellyfish-logger')

logger.warn(context, 'Inserting card', {
    slug: card.slug,
    type: card.type
})