Configuring System Logging for a Single-Chassis System
The Junos system logging utility is similar to the UNIX syslogd utility. This section describes how to configure system logging for a single-chassis system that runs the Junos OS.
System logging configuration for the Junos-FIPS software and for Juniper Networks routing platforms in a Common Criteria environment is the same as for the Junos OS. For more information, see the Secure Configuration Guide for Common Criteria and Junos-FIPS.
Each system log message belongs to a facility, which groups together related messages. Each message is also preassigned a severity level, which indicates how seriously the triggering event affects routing platform functions. You always specify the facility and severity of the messages to include in the log. For more information, see Specifying the Facility and Severity of Messages to Include in the Log.
You direct messages to one or more destinations by including the appropriate statement at the [edit system syslog] hierarchy level:
- To a named file in a local file system, by including the file statement. See Logging Messages in Structured-Data Format.
- To the terminal session of one or more specific users (or all users) when they are logged in to the routing platform, by including the user statement. See Directing Messages to a User Terminal.
- To the routing platform console, by including the console statement. See Directing Messages to the Console.
- To a remote machine that is running the syslogd utility or to the other Routing Engine on the routing platform, by including the host statement. See Directing Messages to a Remote Destination from the Routing Matrix.
By default, messages are logged in a standard format, which is based on a UNIX system log format; for detailed information, see Interpreting Messages Generated in Standard Format by a JUNOS Process or Library, Interpreting Messages Generated in Standard Format by Services on a PIC, and Interpreting Messages Generated in Structured-Data Format. You can alter the content and format of logged messages in the following ways:
- In Junos 8.3 and later, you can log messages to a file in structured-data format instead of the standard Junos format. Structured-data format provides more information without adding significant length, and makes it easier for automated applications to extract information from the message. For more information, see Logging Messages in Structured-Data Format.
- A message’s facility and severity level are together referred to as its priority. By default, the standard Junos format for messages does not include priority information. (Structured-data format includes a priority code by default.) To include priority information in standard-format messages directed to a file or a remote destination, include the explicit-priority statement. For more information, see Including Priority Information in System Log Messages.
- By default, the standard Junos format for messages specifies the month, date, hour, minute, and second when the message was logged. You can modify the timestamp on standard-format messages to include the year, the millisecond, or both. (Structured-data format specifies the year and millisecond by default.) For more information, see Including the Year or Millisecond in Timestamps.
- When directing messages to a remote machine, you can specify the IP address that is reported in messages as their source. You can also configure features that make it easier to separate Junos-specific messages or messages generated on particular routing platforms. For more information, see Directing Messages to a Remote Destination from the Routing Matrix.
- The predefined facilities group together related messages, but you can also use regular expressions to specify more exactly which messages from a facility are logged to a file, a user terminal, or a remote destination. For more information, see Using Regular Expressions to Refine the Set of Logged Messages.
For a statement summary for the statements discussed in this chapter, see the Junos System Basics Configuration Guide.
For detailed information about configuring system logging, see the following sections:
- Specifying the Facility and Severity of Messages to Include in the Log
- Directing Messages to a Log File
- Directing Messages to a User Terminal
- Directing Messages to the Console
- Directing Messages to a Remote Machine or the Other Routing Engine
- Configuring the Size and Number of Log Files
- Including Priority Information in System Log Messages
- Including the Year or Millisecond in Timestamps
- Using Regular Expressions to Refine the Set of Logged Messages
- Disabling Logging of a Facility
- Examples: Configuring System Logging
Hide Navigation Pane
Show Navigation Pane
Download
SHA1