Skip to content

Commit

Permalink
implement the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Sep 23, 2024
1 parent 150f6f1 commit 59151cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/instrumentation/pino/pino.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,15 @@ function reformatLogLine({ logLine, msg, agent, chindings = '', level, logger })
delete metadata.hostname
}

const agentMeta = Object.assign({}, { timestamp: Date.now(), message: msg }, metadata)
const agentMeta = Object.assign({}, { timestamp: Date.now() }, metadata)
// eslint-disable-next-line eqeqeq
if (msg != undefined) {
// The spec lists `message` as "MUST" under the required column, but then
// details that it "MUST be omitted" if the value is "empty". Additionally,
// if someone has logged only a merging object, and that object contains a
// message key, we do not want to overwrite their value. See issue 2595.
agentMeta.message = msg
}

/**
* A function that gets executed in `_toPayloadSync` of log aggregator.
Expand Down

0 comments on commit 59151cb

Please sign in to comment.