npm install syslogudp
var syslog = require('syslog'); var logger = syslog.createClient(514, 'localhost'); logger.info("ping!"); logger.log("Danger Wil Robinson!",logger.LOG_WARNING, callback) logger.close(); // explicitly close the socket
A call to callback sends two parameters - an error object and a string message.
In increasing order of severity:
These are available as methods on Client, ex:
You may also call the
log method, and pass the level as the 2nd argument:
The default level is
Aside from the repo noted above, this node documentation was very helpful in getting this up and running.