tiny-udp-logger
v1.0.2
Published
A tiny logger using UDP.
Downloads
4
Readme
Tiny UDP Logger
A tiny logger using UDP to send log messages.
Install
npm install --save tiny-udp-logger
Usage
- Default mode -- each log message using a new socket
var logger = require('tiny-udp-logger')({port: 514, host: 'localhost'})
logger.log("Hello world!")
logger.log("Hello world!")
logger.log("Hello world!")
Share socket mode -- all log message using a shared socket -- so, don't forget to close the logger so that prevent leaking socket.
var logger = require('tiny-udp-logger')({port: 514, host: 'localhost', shareSocket: true})
logger.log("Hello world!")
logger.log("Hello world!")
logger.log("Hello world!")
logger.log("Hello world!")
logger.log("Hello world!", function(){
logger.close() // close the logger to prevent leaking socket
})