SendPacket Method

Send a log packet to RemoteHost .

Syntax

syslog.sendPacket(facility, severity, message, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

System log packets are composed of three main sections, each of which can be broken down into two smaller pieces.

The first section is the PRI, which contains the originating Facility and Severity of the Message. Facility is a value from 0 to 23, with each value being a different part of the system:

0Kernel messages
1User-level messages
2Mail system
3System daemons
4Security/authorization messages
5Messages generated internally by syslogd
6Line printer subsystem
7Network news subsystem
8UUCP subsystem
9Clock daemon
10Security/authorization messages
11FTP daemon
12NTP subsystem
13Log audit
14Log alert
15Clock daemon
16Local use
17Local use
18Local use
19Local use
20Local use
21Local use
22Local use
23Local use

Severity is a value from 0 to 7 using the following convention:

0Emergency - the system is unusable
1Alert - action must be taken immediately
2Critical - critical conditions exist
3Error - error conditions exist
4Warning - warning conditions exist
5Notice - normal but significant condition
6Informational - informative message
7Debug - debug-level messages

The section sections contains a timestamp and hostname, both of which are automatically generated by the class. The third section is the Message itself.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Node.js Edition - Version 20.0 [Build 8307]