Coder Social home page Coder Social logo

winston-tcp's Introduction

Winston TCP version License

TCP transport for Winston

Build Status Downloads Code Climate Coverage Status Dependency Status Dependencies

Install

npm install --only=production --save winston-tcp

API

import Transport from 'winston-tcp'

let logger = new (winston.Logger)({
  transports: [
    new (Transport)({
      host: '127.0.0.1',
      port: 1337,
      json: true,
      timestamp: true
    })
  ]
})

logger.log('info', 'foo')

or simply:

import winston from 'winston'
import Transport from 'winston-tcp'

winston.add(new Transport({
  host: '127.0.0.1',
  port: 1337
}))

winston.info('foo')

Options

Name Description Default
host The host to connect to none
port The server port to connect to none
reconnectInterval Time to pause between disconnect and reconnect (in ms) 1000
bufferLength Number of messages to buffer while disconnected, set to false for unlimited 10000
json If true, messages will be logged as JSON false
timestamp flag indicating if we should prepend output with timestamps false
formatter a custom formatter (see Winston docs) none

©️ ahmadnassri.com  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.