winston-tcp-infinite
v3.0.3
Published
TCP transport for Winston
Downloads
12
Maintainers
Readme
Winston TCP
[![License][license-image]][license-url]
TCP transport for Winston
[![Build Status][travis-image]][travis-url]
[![Code Climate][codeclimate-quality]][codeclimate-url]
[![Coverage Status][codeclimate-coverage]][codeclimate-url]
[![Dependency Status][dependencyci-image]][dependencyci-url]
[![Dependencies][david-image]][david-url]
Install
npm install --only=production --save winston-tcpAPI
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
reconnectAttempts | Reconnection apttemp count (0 is infinite) | 100
License: [ISC] Github: @createmain ·
