New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

udp-transport-winston

Package Overview
Dependencies
Maintainers
0
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

udp-transport-winston

A winston transport for UDP in typescript

2.0.16
latest
Source
npm
Version published
Weekly downloads
1.7K
30.51%
Maintainers
0
Weekly downloads
 
Created
Source

Github Actions Status npm NPM

UDP-transport-winston

A simple winston transport for UDP in typescript.

Working with winston@3.

Can be used with splunk, logstash (ELK) or any other UDP data inputs.

Usage

Installing

using npm:

npm install winston udp-transport-winston --save

using yarn:

yarn add winston udp-transport-winston

Example

import winston = require('winston');
import { UDPTransport } from 'udp-transport-winston';

const logger: winston.Logger = winston.createLogger({
    level: 'info',
    transports: [
        new UDPTransport({
            host: 'localhost',
            port: 1234
        })
    ]
});

or:

import winston = require('winston');
import { UDPTransport } from 'udp-transport-winston';

const logger: winston.Logger = winston.createLogger({
    level: 'info'
});

logger.add(new UDPTransport({
    host: 'localhost',
    port: 1234
}));

API

  • class UDPTransport
    • constructor(options:TransportOptions)
      • options.host:string UDP host
      • options.port:number UDP port
      • (optional) options.trailingLineFeed:boolean if to make single line
      • (optional) options.trailingLineFeedChar:string character to separate messages
      • (optional) Inherited transport options: options.format, options.level, options.silent, options.handleExceptions

Made by @raz6tamir

Keywords

winston

FAQs

Package last updated on 15 Feb 2025

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