Socket
Socket
Sign inDemoInstall

bunyan-tcp

Package Overview
Dependencies
22
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bunyan-tcp

An adapter stream bunyan events to a TCP socket (with reconnection and buffering)


Version published
Weekly downloads
480
decreased by-16.67%
Maintainers
1
Install size
21.4 kB
Created
Weekly downloads
 

Readme

Source

bunyan-tcp

TCP transport for Bunyan with reconnection.

Quick start:

var tcpStream = bunyanTcp.createBunyanStream({
  server: 'my.logging.server',
  port: 1234,
});

var log = bunyan.createLogger({
    name: 'log',
    streams: [
        {
          level: 'info',
          stream: tcpStream,
          type: 'raw',
          closeOnExit: true
        }
    ]
});

Options

NameDescriptionDefault
server (required)The host to connect tonone
port (required)The server port to connect tonone
reconnectDelayTime to pause between disconnect and reconnect (in ms)5000ms
offlineBufferNumber of messages to buffer while disconnected100 messages
transformA function that takes a bunyan event and returns a JSON object that will be serialized to the remote serveridentity

Events

NameDescriptionArguments
connectingEmitted when the stream attempts a connectionNumber of unsuccessful connection attempts
connectEmitted on successful connectionNumber of successful connections during the life of this process.
disconnectGot disconnected from the remote servernone
dropped_messagesEmitted when the stream reconnects if some events have been discarded to stay in buffer limitsNumber of dropped messages.

Methods

NameDescription
connectIf previously closed, attempts to reconnect. This is called on instantiation.
closeDisconnect from the remote server
bufferedMessageCountIf currently disconnected, the number of messages in offline buffer
droppedMessageCountIf currently disconnected, number of messages that have been discarded

Keywords

FAQs

Last updated on 17 Apr 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc