@entropy/winston-elasticsearch-apm
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/entropy__winston-elasticsearch-apm package

1.0.8 • Public • Published

@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

/@entropy/winston-elasticsearch-apm/

    Package Sidebar

    Install

    npm i @entropy/winston-elasticsearch-apm

    Weekly Downloads

    473

    Version

    1.0.8

    License

    MIT

    Unpacked Size

    5.99 kB

    Total Files

    5

    Last publish

    Collaborators

    • cory.bryant
    • calebweeksentropy
    • aaronharder