Constructor
new RFC5424(optionsopt)
Construct a new RFC5424 formatted Syslog object with user options
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Options object
Properties
|
Requires:
- module:moment
Requires
- module:moment
Members
(private) alertColor
color :boolean
Type:
- boolean
(private) constructor__
(private) criticalColor
(private) debugColor
(private) emergencyColor
includeStructuredData :boolean
Type:
- boolean
(private) errorColor
extendedColor :boolean
Type:
- boolean
(private) informationalColor
(private) noticeColor
(private) server
timestamp :boolean
Type:
- boolean
timestampMS :boolean
Type:
- boolean
timestampTZ :boolean
Type:
- boolean
timestampUTC :boolean
Type:
- boolean
utf8BOM :boolean
Type:
- boolean
(private) warningColor
Methods
alert(msg) → {Promise}
Send a syslog message with a severity level of 1 (Alert)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The alert message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
buildMessage(msg, optionsopt) → {Promise}
Building a formatted message. Returns a promise with a formatted message
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
msg |
string | The Syslog Message | |||||||||||||||||||||||||||||||
options |
object |
<optional> |
Options object
Properties
|
Throws:
-
A standard error object
- Type
- Error
Returns:
A Syslog formatted string according to the selected RFC
- Type
- Promise
crit(msg) → {Promise}
Send a syslog message with a severity level of 2 (Critical)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The critical message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
critical(msg) → {Promise}
Send a syslog message with a severity level of 2 (Critical)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The critical message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
debug(msg) → {Promise}
Send a syslog message with a severity level of 7 (Debug)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The debug message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
emer(msg) → {Promise}
Send a syslog message with a severity level of 0 (Emergency)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The emergency message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
emergency(msg) → {Promise}
Send a syslog message with a severity level of 0 (Emergency)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The emergency message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
err(msg) → {Promise}
Send a syslog message with a severity level of 3 (Error)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The error message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
error(msg) → {Promise}
Send a syslog message with a severity level of 3 (Error)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The error message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
info(msg) → {Promise}
Send a syslog message with a severity level of 6 (Informational)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The informational message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
informational(msg) → {Promise}
Send a syslog message with a severity level of 6 (Informational)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The informational message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
log(msg) → {Promise}
Send a syslog message with a severity level of 6 (Informational)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The informational message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
note(msg) → {Promise}
Send a syslog message with a severity level of 5 (Notice)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The notice message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
notice(msg) → {Promise}
Send a syslog message with a severity level of 5 (Notice)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The notice message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
send(msg) → {Promise}
send a RFC5424 formatted message. Returns a promise with the formatted
message that was sent. If no server connection was defined when the
class was created a default Syslog connector will be used.
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The unformatted Syslog message to send |
Throws:
-
A standard error object
- Type
- Error
Returns:
A Syslog formatted string according to the selected RFC
- Type
- Promise
setColor()
Sets the color to be used for messages at a set priority
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
colors.emergencyColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.alertColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.criticalColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.errorColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.warningColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.noticeColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.informationalColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
colors.debugColor |
string |
<optional> |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
Throws:
-
A standard error object
- Type
- Error
warn(msg) → {Promise}
Send a syslog message with a severity level of 4 (Warning)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The warning message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise
warning(msg) → {Promise}
Send a syslog message with a severity level of 4 (Warning)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | The warning message to send to the Syslog server |
Throws:
-
- Any bubbled-up error
- Type
- Error
Returns:
- The formatted syslog message sent to the Syslog server
- Type
- Promise