newrelic / node-newrelic

New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
Apache License 2.0
969 stars 398 forks source link

Pino instrumentation is changing application logs #1229

Closed artur-ma closed 2 years ago

artur-ma commented 2 years ago

Hey, we are using Pino in our Nodejs application, and looks like pino instrumentation added in latest version changes the global Pino formatter(!)

Description

Our application logs have specific format where the field "time" represents the time of the log and "msg" represents the log message, but looks like newrelic sdk breaks it here

"time" replaced with "timestamp" "msg" replaced with "message"

Expected Behavior

newrelic SDK should not change the application logging format

Steps to Reproduce

create any app with pino, print some logs, then install and require newrelic, u will see the field "time" was changed to "timestamp"

Your Environment

nodejs 16.11 newrelic 8.13.1

Additional context

This is critical, since this is breaking change as minor.

artur-ma commented 2 years ago

without newrelic

> logger.info('test')
{"level":"info","time":1653940991859,"pid":59702,"host":"---","name":"default","meta":{"arrayMeta":[]},"msg":"test"}
undefined

with newrelic

> logger.info('test')
{"level":"info","timestamp":1653941137275,"pid":61302,"host":"---","name":"default","meta":{"arrayMeta":[]},"message":"test"}
bizob2828 commented 2 years ago

@artur-ma sorry for the troubles. In the meantime you can disable the application logging feature : application_logging.enabled = false.