Including Priority in System Log Messages
A message's facility and severity level are together referred to as its priority. By default, the system logging utility does not include information about priority in system log messages.
To include the priority in messages directed to a file, include the
explicit-prioritystatement at the[edit system syslog filefilename]hierarchy level:[edit system syslog filefilename]facility severity;explicit-priority;To include the priority in messages directed to a remote machine or the other Routing Engine, include the
explicit-prioritystatement at the[edit system syslog host(hostname| other-routing-engine)]hierarchy level:[edit system syslog host (hostname| other-routing-engine)]facility severity;explicit-priority;When the
explicit-prioritystatement is included, the message string includes the facility name and a numerical code representing the severity level. The name and number appear directly before the message tag. (The tag is a unique identifier assigned to some JUNOS system log messages; for more information, see Interpreting System Log Messages and Displaying and Interpreting System Log Message Descriptions.)The message string always reports the original, local facility name. If the message belongs to a facility with a JUNOS-specific name, the JUNOS system logging utility still uses the alternative facility name for the message itself when it directs the message to a remote destination. For more information, see Changing the Alternative Facility Name for Remote Messages.
Table 11 lists the facility codes that can appear in system log messages and maps them to facility names.
NOTE: If Table 11 does not provide the facility name for a code, you cannot include the facility in a statement at the
[edit system syslog]hierarchy level. The JUNOS software might use these facilities—and others that are not listed—when reporting on internal operations.
Table 12 lists the numerical severity codes that can appear in system log messages and maps them to severity levels.
In the following example, the
CHASSISD_PARSE_COMPLETEmessage belongs to thedaemonfacility and is assigned severityinfo(6):Aug 21 12:36:30 router1 chassisd[522]: %DAEMON-6-CHASSISD_PARSE_COMPLETE: Using new configurationWhen the
explicit-prioritystatement is not included, the priority does not appear in the message, which has the following format:Aug 21 12:36:30 router1 chassisd[522]: CHASSISD_PARSE_COMPLETE: Using new configurationFor more information about message formatting, see Displaying and Interpreting System Log Messages.