Socket
Book a DemoInstallSign in
Socket

bunyan-tcp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

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)

0.9.5
latest
Source
npmnpm
Version published
Weekly downloads
272
-9.03%
Maintainers
1
Weekly downloads
 
Created
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

bunyan

FAQs

Package last updated on 17 Apr 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.