Wrapper for https://www.npmjs.com/package/syslog-client package
npm install node-syslog-client-bsdWrapper for https://www.npmjs.com/package/syslog-client package
yarn add node-syslog-client-bsd or npm i node-syslog-client-bsd
``javascript
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)
`javascript
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. Default N/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
`javascript`
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