3.0.3 • Published 4 years ago

winston-tcp-infinite v3.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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

NameDescriptionDefault
hostThe host to connect tonone
portThe server port to connect tonone
reconnectIntervalTime to pause between disconnect and reconnect (in ms)1000
bufferLengthNumber of messages to buffer while disconnected, set to false for unlimited10000
jsonIf true, messages will be logged as JSONfalse
timestampflag indicating if we should prepend output with timestampsfalse
formattera custom formatter (see Winston docs)none
reconnectAttemptsReconnection apttemp count (0 is infinite)100

License: ISC Github: @createmain  ·