Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {