You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Node.js agent decoration without forwarding option for Logs in Context with pino, if the logger API is called with a mergingObject instead of a string as the only argument, the library fails to take into account that the msg field in the object, always taking args[1] to decorate and eventually setting msg as undefined NR LINKING xxxx.
Expected Behavior
Pino logs that are submitted as objects with a field msg or message have the msg/message field decorated with the NR LINKING attributes and set correctly.
This is open with NewRelic support as Case #00215731
As a temporary workaround, we can send the msg portion as a second argument to pino in the form of logger.error({ ...OUROBJECT }, msg), but that is cumbersome :) This behaviour is probably unexpected for a JSON logger that's looking for msg!
The text was updated successfully, but these errors were encountered:
Description
When using the Node.js agent decoration without forwarding option for Logs in Context with
pino
, if the logger API is called with amergingObject
instead of a string as the only argument, the library fails to take into account that themsg
field in the object, always takingargs[1]
to decorate and eventually settingmsg
asundefined NR LINKING xxxx
.Expected Behavior
Pino logs that are submitted as objects with a field
msg
ormessage
have themsg/message
field decorated with the NR LINKING attributes and set correctly.Steps to Reproduce
Relevant section of
newrelic.cjs
:If you console log out
arguments
in the instrumentation file when only a mergingObject is supplied, you get:The resultant badly-decorated log looks like the following after the metadata is added.
This is opposed to just sending a string
logger.warn('a string'))
, which populates args[1] and generates a working log:Your Environment
newrelic 11.23.2
pino 9.3.2
Additional Context
This is open with NewRelic support as Case #00215731
As a temporary workaround, we can send the
msg
portion as a second argument to pino in the form oflogger.error({ ...OUROBJECT }, msg)
, but that is cumbersome :) This behaviour is probably unexpected for a JSON logger that's looking for msg!The text was updated successfully, but these errors were encountered: