winstonjs / winston-syslog

A syslog transport for winston
http://github.com/winstonjs/winston-syslog
MIT License
138 stars 119 forks source link

Usage: please correct "type" options #158

Closed zit0un closed 3 years ago

zit0un commented 3 years ago

Usage describes different options for winston.transports.Syslog. Among them type: The type of the syslog protocol to use (Default: BSD, also valid: 5424).

But if you specify

logger.add(
  new winston.transports.Syslog({
    type: 5424,
    protocol: 'unix',
    path: '/var/run/syslog',
  })
)

You'll get an error:

this.type = options.type.match(/bsd|3164/i) ? "RFC3164" : "RFC5424";

A correct option for "type" option is thus 'bsd', '3164', '5424', (as strings, and not simply 3164 or 5424 as numbers), 'RFC3164' or 'RFC5424'.

zit0un commented 3 years ago

I created a pull request.