Skip to content

Commit

Permalink
chore: update pino child
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilash-sivan committed Nov 19, 2024
1 parent 5e5f845 commit ce96271
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/collector/src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const registry = {};
* @param {boolean} [isReInit]
*/
exports.init = function init(config, isReInit) {
if (config.logger && isPino(config.logger)) {
if (config.logger && typeof config.logger.child === 'function') {
// A pino logger has been provided via config; create a child logger directly under it.
parentLogger = config.logger.child({
module: 'instana-nodejs-logger-parent',
Expand All @@ -42,7 +42,7 @@ exports.init = function init(config, isReInit) {
parentLogger = config.logger;
} else {
// No custom logger has been provided; create a new pino logger as the parent logger for all loggers
parentLogger = pino({
parentLogger = pino.child({
name: '@instana/collector',
level: 'info',
base: {
Expand Down

0 comments on commit ce96271

Please sign in to comment.