Builds a syslog message at error severity.
The message is normalized and validated before serialization. Invalid option values throw TypeErrors with field-specific messages.
TypeError
The return value is a string in RFC 5424 format: PRI VERSION TIMESTAMP HOSTNAME APP-NAME PROCID MSGID STRUCTURED-DATA [MSG]
PRI VERSION TIMESTAMP HOSTNAME APP-NAME PROCID MSGID STRUCTURED-DATA [MSG]
When msg is "", null, or undefined, the MSG trailing free-text message portion is omitted entirely.
msg
""
null
undefined
MSG
Optional
Optional free-text syslog message body.
Header and structured data overrides.
Serialized RFC 5424 syslog message.
Thrown when any option is invalid.
Builds a syslog message at error severity.
The message is normalized and validated before serialization. Invalid option values throw
TypeErrors with field-specific messages.The return value is a string in RFC 5424 format:
PRI VERSION TIMESTAMP HOSTNAME APP-NAME PROCID MSGID STRUCTURED-DATA [MSG]When
msgis"",null, orundefined, theMSGtrailing free-text message portion is omitted entirely.