@entropy/winston-elasticsearch-apm
Winston transport to send error stacks to Elasticsearch APM
Install
npm install @entropy/winston-elasticsearch-apm --save
Usage
Winston@3
var winston = require('winston');
var ElasticsearchApm = require('@entropy/winston-elasticsearch-apm');
var apm = require('elastic-apm-node').start({
serviceName: 'app',
serverUrl: 'http://localhost:8200',
});
var logger = winston.createLogger({
transports: [
new ElasticsearchApm({ apm: apm })
]
});
logger.log({ level: "error", message: err });
Winston@2
var winston = require('winston');
var ElasticsearchApm = require('@entropy/winston-elasticsearch-apm/legacy');
var apm = require('elastic-apm-node').start({
serviceName: 'app',
serverUrl: 'http://localhost:8200',
});
var logger = new winston.Logger();
logger.add(ElasticsearchApm, { apm: apm });
logger.error(err);
Options
- apm: A predefined Elasticsearch APM object (Required)
Tests
A running APM server is required to run tests
npm test