Table of Contents


This documents the Hop.js builtin syslog api.

Use require( hop.syslog ) to use it.

Additional information regarding syslog can be obtained in the Unix man page.

Functions name, option, facility )

Initialize the syslog connection. The option argument is a bit-or combination of the following values:

The value facility must be one of:

syslog.log( level, msg )

Emit a log message. The argument msg is a string. The argument level denotes the importance of the message. The levels are, in order of decreasing importance:


Closes the syslog connection.


This example shows how to open a SYSLOG connection and how to emit messages.


var Syslog = require( hop.syslog ); "hopjs-syslog", Syslog.LOG_PID | Syslog.LOG_ODELAY, Syslog.LOG_LOCAL0 );

Syslog.log( Syslog.LOG_INFO, "A hop.js message [v" + process.versions.hop + "]" ) ;


console.log( "check your log file (typically /var/log/syslog)" );