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.
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.
npm install @newrelic/winston-enricher
// 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.
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.
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
- New Relic Documentation: Comprehensive guidance for using our platform
- New Relic Community: The best place to engage in troubleshooting questions
- New Relic Developer: Resources for building a custom observability applications
- New Relic University: A range of online training for New Relic users of every level
- [For Community Plus repositories] New Relic Technical Support 24/7/365 ticketed support. Read more about our Technical Support Offerings.
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.
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.
newrelic-winston-logenricher-node
is licensed under the Apache 2.0 License.