How to use the roarr.default.child function in roarr

To help you get started, we’ve selected a few roarr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stelace / stelace / logger.js View on Github external
const log = require('roarr').default
const { serializeError } = require('serialize-error')
const apm = require('elastic-apm-node')
const _ = require('lodash')

const params = {
  application: 'stelace-core'
}

if (process.env.INSTANCE_ID) {
  params.instanceId = process.env.INSTANCE_ID
}

const RoarrLogger = log.child(params)

// const PROD = process.env.NODE_ENV === 'production'

/**
 * This function is only used to log metrics in server.js
 * The arguments map to Roarr trace function arguments
 * https://github.com/gajus/roarr#roarr-api-trace
 *
 * Usually:
 * @param {Object} context
 * @param {String} message
 *
 * This function won't log into APM server (unlike logError)
 * because APM request transactions are more precise than manually metrics build
 */
function logTrace (...args) {

roarr

JSON logger for Node.js and browser.

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

80 / 100
Full package analysis