@opentelemetry/winston-transport
OpenTelemetry Transport for winston
Last updated 2 years ago by dyladan .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @opentelemetry/winston-transport 
SYNC missed versions from official npm registry.

OpenTelemetry transport for winston

NPM Published Version Apache License

This module provides a Transport for winston module to send Winston logging to the OpenTelemetry Logging SDK.

Compatible with OpenTelemetry JS API and SDK 1.0+.

Installation

npm install --save @opentelemetry/winston-transport

Usage

This package exports the Winston transport class that is used to send records to the OpenTelemetry Logs SDK. It can be used directly when configuring a Winston logger. If using @opentelemetry/instrumenation-winston package there is no need to instantiate the transport as the instrumentation will take care of that. For example:

const logsAPI = require('@opentelemetry/api-logs');
const {
    LoggerProvider,
    SimpleLogRecordProcessor,
    ConsoleLogRecordExporter,
} = require('@opentelemetry/sdk-logs');
const { OpenTelemetryTransportV3 } = require('@opentelemetry/winston-transport');
const winston = require('winston');


// To start a logger, you first need to initialize the Logger provider.
const loggerProvider = new LoggerProvider();
// Add a processor to export log record
loggerProvider.addLogRecordProcessor(
    new SimpleLogRecordProcessor(new ConsoleLogRecordExporter())
);
logsAPI.logs.setGlobalLoggerProvider(loggerProvider);

const logger = winston.createLogger({
  level: 'info',
  transports: [
    new winston.transports.Console(),
    new OpenTelemetryTransportV3()
  ]
});

Supported versions

Winston 3.x

Useful links

License

Apache 2.0 - See LICENSE for more information.

Current Tags

  • 0.35.0                                ...           latest (a month ago)

39 Versions

  • 0.35.0                                ...           a month ago
  • 0.34.0                                ...           a month ago
  • 0.33.0                                ...           2 months ago
  • 0.32.0                                ...           3 months ago
  • 0.31.0                                ...           4 months ago
  • 0.30.0                                ...           5 months ago
  • 0.29.0                                ...           6 months ago
  • 0.28.0                                ...           7 months ago
  • 0.27.0                                ...           7 months ago
  • 0.26.0                                ...           7 months ago
  • 0.25.0                                ...           7 months ago
  • 0.24.0                                ...           8 months ago
  • 0.23.0                                ...           9 months ago
  • 0.22.0                                ...           9 months ago
  • 0.21.0                                ...           10 months ago
  • 0.20.0                                ...           10 months ago
  • 0.19.0                                ...           a year ago
  • 0.18.0                                ...           a year ago
  • 0.17.0                                ...           a year ago
  • 0.16.2                                ...           a year ago
  • 0.16.1                                ...           a year ago
  • 0.16.0                                ...           a year ago
  • 0.15.0                                ...           a year ago
  • 0.14.1                                ...           a year ago
  • 0.14.0                                ...           a year ago
  • 0.13.0                                ...           a year ago
  • 0.12.0                                ...           2 years ago
  • 0.11.0                                ...           2 years ago
  • 0.10.1                                ...           2 years ago
  • 0.10.0                                ...           2 years ago
  • 0.9.0                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Downloads
Total 36
Today 0
This Week 18
This Month 31
Last Day 4
Last Week 1
Last Month 3
Dependencies (2)
Dev Dependencies (10)

© 2010 - cnpmjs.org x YWFE | Home | YWFE