Log Sink
A service for streaming, storage and query of log data.
This is the client-side implementation for both Nodejs and the browser. For the server-side implementation and server public API, see log-sink-server.
Install
npm install log-sink --save
Usage
var sink = fs = // Connect to log sink server using a secure connectionsink// In the browser, use:sink // Write// sink.{debug,info,warn,error,fatal}(name, [message], [extra])// If the connection is not ready yet, it will be buffered and// executed when it gets readysinksink // Or avoid typing the required name every timevar logger = sinklogger // Streamingsink // Queryingsink
The only difference between the use in Nodejs and browsers is the third connect
parameter. In Nodejs, it's an object; for browser it's the WS url.
Browsers will connect using WebSocket and Nodejs will use TCP directly. Note that the ports are NOT the same.
Multiple connections
var sink = conn = conn2 = connconn2
Log Sink
To understand more about log sink, read the doc on the server project
Docs
All public methods are described in the generated docs