[Contents]
[Prev]
[Next]
[Index]
[Report an Error]
jcs:syslog() Function
The jcs:syslog() function logs messages to the syslog
with a specified priority.
The function syntax is as follows:
expr jcs:syslog(priority, “message”, <$goesto>, <$syslog>));
Where:
-
priority—The priority given to the syslog
message. The priority can be specified as a facility/severity pair,
or it can be a numeric priority value based on the facility/severity
pair. Table 17 and Table 18 show the facility and severity
strings available and the corresponding numeric value for each string.
The priority numeric value is calculated by multiplying the
facility string value by 8 and adding the severity string. For example,
if the facility/severity string pair is pfe:alert, the priority numeric
value is 161 (20 x 8+1).
-
message—Message to add to the system log
file.
-
$goesto—(Optional) You can pass variable
names as an argument to the function.
-
$syslog—(Optional) You can pass the name
of the system log file as an argument to the function.
The message added to the syslog file is specified within the [system syslog] hierarchy of the router configuration file.
Table 17: Facility Strings
| Facility String | Description | Numeric Value |
|
auth
|
Authorization system
|
4
|
|
change
|
Configuration change log
|
22
|
|
conflict
|
Configuration conflict log
|
21
|
|
daemon
|
Various system processes
|
3
|
|
external
|
Local external applications
|
18
|
|
firewall
|
Firewall filtering system
|
19
|
|
ftp
|
FTP processes
|
11
|
|
interact
|
Commands executed by thye UI
|
23
|
|
pfe
|
Packet forwarding engine
|
20
|
|
user
|
User processes
|
1
|
Table 18: Severity String
| Severity String | Description | Numeric Value |
|
alert
|
Conditions that should be corrected immediately
|
1
|
|
crit
|
Critical conditions
|
2
|
|
debug
|
Debug messages
|
7
|
|
emerg or panic
|
Panic conditions
|
0
|
|
err or error
|
Error conditions
|
3
|
|
info
|
Informational messages
|
6
|
|
notice
|
Conditions that should be specially handled
|
5
|
|
warn or warning
|
Warning messages
|
4
|
[Contents]
[Prev]
[Next]
[Index]
[Report an Error]