Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@acteam-it/winston-socket.io

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acteam-it/winston-socket.io

A winston transport that will emit logs to a socket.io server.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

winston-socket.io

Build Status Dependency Status

A socket.io transport for winstonjs. Gives you the ability to log directly to a socket.io server.

See the examples folder for more usage details.

Options

  • host: The hostname of the socket.io server (default: http://localhost).
  • port: The port of the socket.io server (default: 3000).
  • secure: Use https for the socket.io server connection (default: false).
  • reconnect: Reconnect to socket.io server connection (default: false).
  • namespace: The socket.io namespace to use for the logs (default: "log").
  • log_topic: The topic to send the log messages on (default: "log").
  • encrypt: Choose to encrypt winston socket logs or not (default: false)
  • secret: the passphrase to encrypt logs with [needs encrypt to be true to allow changing it ] (default: null)
  • log_format: The format in which to log the information.
  • max_queue_size: The maximum number of messages to queue up for publishing if the client isnt connected to the server (default: 1000).

How to use it

  const winston = require('winston');
  require('winston-socket.io');

  let logger = winston.createLogger({
    level: "info",
    transports: [
      new winston.transports.Console(),
      new winston.transports.SocketIO(
        {
          host: "http://myhost",
          port: 8080
          secure: true,
          reconnect: true,
          namespace: "log",
          log_topic: "log"
        }
      )
    ]
  });  

  logger.log("info", "I'm logging to the socket.io server!!!");
  logger.log("info", "I'm logging something else", {meta: "some additional info"});

Can also be added to Winston as a transport in this method


  const winston = require('winston');
  require('winston-socket.io');

  winston.add(new winston.transports.SocketIO({
    host: "http://myhost",
    port: 8080
    secure: true,
    reconnect: true,
    namespace: "log",
    log_topic: "log"
  }));

Keywords

FAQs

Package last updated on 03 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc