jcs:syslog() Function

Syntax

jcs:syslog(priority, message, <message2>, <message3> ...)

Description

Log messages with the specified priority to the system log file. The priority can be expressed as a facility.severity string or as a calculated integer. The message argument is a string or variable that is written to the system log file. Optionally, additional strings or variables can be included in the argument list. The message argument is concatenated with any additional parameters, and the concatenated string is written to the system log file. The syslog file is specified at the [edit system syslog] hierarchy level of the device configuration file.

Parameters

The following three examples log pfe messages with an alert priority. The string "mymessage" is output to the system log file. All three examples are equivalent:

expr jcs:syslog("pfe.alert", "mymessage");
   
expr jcs:syslog(161, "mymessage");
   
var $message = "mymessage";
expr jcs:syslog("pfe.alert", $message);

The following example logs pfe messages with an alert priority similar to the previous example. In this example, however, there are additional string parameters. For this case, the concatenated string "mymessage mymessage2" is output to the system log file.

expr jcs:syslog("pfe.alert", "mymessage ", "mymessage2");