winston-logstash-transport-wenpin
v2.0.1
Published
winston-logstash-transport
Downloads
3
Maintainers
Readme
A fork of winston-logstash-transport with TCP support instead of UDP
Example
const logger = require('winston-logstash-transport').createLogger(null, {
application: 'website-ssr-prod',
logstash: {host: 'logstash-host', port: 12345},
transports: [
new winston.transports.Console(),
]
})
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format.json(),
winston.format.timestamp()
),
transports: [
new winston.transports.Console(),
new LogstashTransport({host: 'logstash-host', port: 12345})
]
})
API
class LogstashTransport
options
options.host
, logstash hostoptions.port
, logstash TCP port
createLogger()
application
, The name of applicationhostname=os.hostname()
, The host where application run on.level='info'
, log leveltransports=[]
, others transports for winstonlogstash
, options for LogstashTransport