Wrapper for https://www.npmjs.com/package/syslog-client package
yarn add node-syslog-client-bsd
or npm i node-syslog-client-bsd
const SyslogClient = require("node-syslog-client-bsd");
IP
: IP of your syslog server[options]
: can be find here : https://www.npmjs.com/package/syslog-client#syslogcreateclienttarget-options
Return new instance of SyslogClient (constructor)
const options = {
syslogHostname: 'home-api.local',
};
const logClient = new SyslogClient('10.0.0.15', options);
Return the instance of syslog-client based on syslog-client package
sets the program for all calls according to the setter
reset the program for all calls according to the reset
sets the facility for all calls according to the setter
reset the facility for all calls according to the reset
message
: message to log[program]
: set the program specific for one log. DefaultN/A
[options]
: options based on syslog-client options. It overloads what you've already set up
you have access to all these functions depending on the level
logClient.info('Log infos!');
logClient.warning('Log warning!');
logClient.error('Log error!');
logClient.debug('Log debug!');
logClient.emergency('Log emergency!');
logClient.alert('Log alert!');
logClient.critical('Log critical!');
logClient.notice('Log notice!');
You can find an example in ./example/index.js
. The screenshot below shows you its result (on an Synology NAS)
- https://www.npmjs.com/package/syslog-client
- https://www.ietf.org/rfc/rfc3164.txt
- https://tools.ietf.org/html/rfc5424
- Init project