Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namshi/newrelic-winston
https://github.com/namshi/newrelic-winston
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/namshi/newrelic-winston
- Owner: namshi
- Created: 2015-08-03T08:21:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T14:25:42.000Z (over 2 years ago)
- Last Synced: 2024-10-29T16:25:24.808Z (9 days ago)
- Language: JavaScript
- Size: 62.5 KB
- Stars: 10
- Watchers: 35
- Forks: 11
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# newrelic-winston [![Build Status](https://secure.travis-ci.org/namshi/newrelic-winston.png)](http://travis-ci.org/namshi/newrelic-winston)
A [newrelic][0] transport for [winston][1] including the [newrelic][2] Library
## Installation
Tested on node-6.x, requires npm.
``` sh
$ npm install winston --save
$ npm install newrelic-winston --save
```## Usage
```javascript
const winston = require('winston');
const NewrelicWinston = require('newrelic-winston');
winston.add(new NewrelicWinston(options));```
or
```javascript
const { createLogger } = require('winston');
const NewrelicWinston = require('newrelic-winston');
const logger = createLogger({
transports: [
new NewrelicWinston(options),
],
});
```
## Options
* __env__: the current evironment. Defatuls to `process.env.NODE_ENV`If `env` is either 'dev' or 'test' the lib will _not_ load the included newrelic module saving devs from anoying errors ;)
## Config
Please refer to the [newrelic lib's readme](https://github.com/newrelic/node-newrelic#configuring-the-module) for specific module's configs.## Log Levels
This trasport is meant to report errors to newrelic, so the only level available in order to log something is **error****All other possible winston's levels, or custom levels, will noop**
[0]: http://newrelic.com/
[1]: https://github.com/flatiron/winston
[2]: https://github.com/newrelic/node-newrelic