coralogix-logger-winston
v1.0.12
Published
Winston transport for sending logs to coralogix
Downloads
7,726
Readme
Description
Use coralogix-logger-winston to easily add a transport to winston inorder to send your logs to Coralogix's log analytics platform.
Installation
npm install --save coralogix-logger-winston
Javascript example (see ts example below)
var winston = require("winston");
var CoralogixWinston = require("coralogix-logger-winston");
// global configuration for coralogix
var config = {
privateKey: "9626c7dd-8174-5015-a3fe-5572e042b6d9",
applicationName: "YOUR APP NAME",
subsystemName: "YOUR SUBSYSTEM",
};
CoralogixWinston.CoralogixTransport.configure(config);
// configure winston to user coralogix transport
winston.configure({
transports: [new CoralogixWinston.CoralogixTransport({
category: "YOUR CATEGORY"
})]
});
// use winston
winston.info("use winston to send your logs to coralogix");
Typescript example
import * as winston from "winston";
import {CoralogixTransport} from "coralogix-logger-winston";
// global configuration for private key, application name, subsystem name
const config = {
privateKey: "YOUR PRIVATE KEY",
applicationName: "YOUR APP NAME",
subsystemName: "YOUR SUBSYSTEM"
}
CoralogixTransport.configure(config);
winston.configure({
transports:[new CoralogixTransport({
category:"Yoni"
})]
})
winston.info("use winston to send your logs to coralogix");