node-syslog-client-bsd

1.0.1 • Public • Published

node-syslog-client-bsd

Wrapper for https://www.npmjs.com/package/syslog-client package

Install

yarn add node-syslog-client-bsd or npm i node-syslog-client-bsd

Usage

Import package

 
const SyslogClient = require("node-syslog-client-bsd");
 

new SyslogClient(IP, [options]);

Return new instance of SyslogClient (constructor)

const options = {
  syslogHostname: 'home-api.local',
};
 
const logClient = new SyslogClient('10.0.0.15', options);

SyslogClient.getClient()

Return the instance of syslog-client based on syslog-client package

SyslogClient.setProgram(program)

sets the program for all calls according to the setter

SyslogClient.resetProgram()

reset the program for all calls according to the reset

SyslogClient.setFacility(facility)

sets the facility for all calls according to the setter

SyslogClient.resetFacility()

reset the facility for all calls according to the reset

log(message, [program], [options])

  • 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

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!');

Example

You can find an example in ./example/index.js. The screenshot below shows you its result (on an Synology NAS)

syslog-alt

Useful links

Changelog

March 2019

  • Init project

Readme

Keywords

Package Sidebar

Install

npm i node-syslog-client-bsd

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

58.8 kB

Total Files

7

Last publish

Collaborators

  • clement-berard