Socket
Book a DemoInstallSign in
Socket

coralogix-logger-winston

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coralogix-logger-winston

Winston transport for sending logs to coralogix

latest
npmnpm
Version
1.0.12
Version published
Maintainers
3
Created
Source

npm version

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");

Keywords

coralogix

FAQs

Package last updated on 20 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts