Nuclear Planning Manual

    winston-logstash-transport

    2.0.0 • Public • Published

    winston-logstash-transport

    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 host
      • options.port, logstash UDP port
    • createLogger()

      • application, The name of application
      • hostname=os.hostname(), The host where application run on.
      • level='info', log level
      • transports=[], others transports for winston
      • logstash, options for LogstashTransport

    Install

    npm i winston-logstash-transport

    DownloadsWeekly Downloads

    5,326

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    9.68 kB

    Total Files

    4

    Last publish

    Collaborators

    • liuyanjie