Configuring System Logging for a Single-Chassis System
The JUNOS system logging utility is similar to the UNIX
syslogdutility. This section describes how to configure system logging for a single-chassis system that runs the JUNOS software.The system logging configuration statements for the JUNOS-FIPS software and for Juniper Networks routing platforms in a Common Criteria environment are the same as for the JUNOS software. For more information, see the Secure Configuration Guide for Common Criteria and JUNOS-FIPS.
For information about configuring system logging for a routing matrix, see Configuring System Logging for a Routing Matrix.
When you configure system logging, you can 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
filestatement. See Directing Messages to a Log File.- 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
userstatement. See Directing Messages to a User Terminal.- To the routing platform console, by including the
consolestatement. See Directing Messages to the Console.- To a remote machine that is running the
syslogdutility or to the other Routing Engine on the routing platform, by including thehoststatement. See Directing Messages to a Remote Machine or the Other Routing Engine.Each system log message belongs to a facility, which is a group of messages that are either generated by the same software process or concern a similar condition or activity (such as authentication attempts). To log the messages belonging to one or more facilities to a particular destination, specify each facility name as a separate statement within the set of statements for the destination.
Table 7 lists the JUNOS system logging facilities that you can specify in configuration statements at the
[edit system syslog]hierarchy level.
Each message is also preassigned a severity level, which indicates how seriously the triggering event affects routing platform functions. When you configure logging for a facility and destination, you specify a severity level for each facility; messages from the facility that are rated at that level or higher are logged to the destination.
Unlike the other severity levels, the
nonelevel disables logging of a facility instead of indicating how seriously a triggering event affects routing functions. For more information, see Disabling Logging of a Facility.Table 8 lists the severity levels that you can specify in configuration statements at the
[edit system syslog]hierarchy level. The levels fromemergencythroughinfoare in order from highest severity (greatest effect on functioning) to lowest.
A message's facility and severity level are together referred to as its priority. By default, priority information is not included in system log messages. To include priority information in messages directed to a file or a remote destination, include the
explicit-prioritystatement. For more information, see Including Priority in System Log Messages.You can modify the timestamp on system log messages to include the year, the millisecond, or both. For more information, see Including the Year or Millisecond in Timestamps.
When directing messages to a remote machine, you can specify the source address to use, and you can 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 Machine or the Other Routing Engine.
The predefined facilities group together related messages, but you can also use regular expression matching 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
syslogstatement, see the JUNOS System Basics Configuration Guide.For more information about configuring system logging, see the following sections:
- 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 Log File Archiving
- Including Priority 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