/newrelic-winston-logenricher-node

This is no longer maintained. The work has been moved to https://github.com/newrelic/newrelic-node-log-extensions/tree/main/packages/winston-log-enricher

Primary LanguageJavaScriptApache License 2.0Apache-2.0

This is repository is no longer maintained. The relevant code has been moved to https://github.com/newrelic/newrelic-node-log-extensions/tree/main/packages/winston-log-enricher.




Community Plus header

@newrelic/winston-enricher

New Relic's official winston log enricher for use with the Node Agent.

The winston-enricher log format adds additional app, distributed trace and span information output as JSON-formatted log messages. This is most commonly used with the New Relic Logs product.

For the latest information, please see the New Relic docs.

Installation

npm install @newrelic/winston-enricher

Usage

// index.js
require('newrelic')
const newrelicFormatter = require('@newrelic/winston-enricher')

The New Relic formatter can be used individually or combined with other formatters as the final format.

format: winston.format.combine(
  winston.format.label({label: 'test'}),
  newrelicFormatter()
)

Note for unhandledException log messages:

The stack trace will be written to the error.stack property.

To accommodate the New Relic Logs 4000 character log line limit, the stack and trace properties will be removed and the message, error.message and error.stack values will be truncated to 1024 characters.

Version Requirements

winston versions 3.0.0 and greater are supported.

For more information, including currently supported Node versions, please see the agent compatibility and requirements.

For general agent setup, please see the agent installation guide.

Support

Should you need assistance with New Relic products, you are in good hands with several support channels.

If the issue has been confirmed as a bug or is a feature request, file a GitHub issue.

Support Channels

Privacy

At New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.

We define “Personal Data” as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address, and email address.

For more information, review New Relic’s General Data Privacy Notice.

Contribute

Contributions are welcome (and if you submit a Enhancement Request, expect to be invited to contribute it yourself 😁). Please review our Contributors Guide.

Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at opensource+newrelic-winston-logenricher-node@newrelic.com.

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

If you would like to contribute to this project, review these guidelines.

To all contributors, we thank you! Without your contribution, this project would not be what it is today. We also host a community project page dedicated to New Relic Winston Log Enricher.

License

newrelic-winston-logenricher-node is licensed under the Apache 2.0 License.