Configuring Event Logging
By default, event logging is enabled and has default settings. This section explains how to change settings to customize event logging to fit your needs.
host1#baseline log 11:12:55 April 30 2002Set the log severity. host1(config)#log severity warningRemove the limit on the number of buffers available for an event category. host1(config)#log unlimit qosSet the log verbosity. host1(config)#log verbosity lowLog messages to a specified destination. host1(config)#log destination syslog 10.10.9.5 include ospfGeneral mplsGeneral osSelect fields to be added to logs. host1(config)#log fields timestamp instance no-calling-taskEnable logs destined for a console to be displayed at the current console device. host1#log hereThe next sections explain how to configure individual and systemwide logs, how to format timestamps for log messages, and how to configure log filters.
baseline log
- Use to set a baseline for logging events. Only log messages timestamped after the baseline appear when you enter the show log data delta command.
- To use the current system time, do not enter any options.
- To set a specific time, use the following syntax:
Hour:Minute[:Second]Current time in 24-hour format. Seconds are optional.
- utcEnter this keyword to indicate that the time entered is in universal coordinated time (UTC), rather than local time.
- To set a specific date, use the following syntax:
Month Day YearYou must spell out the name of the month.
- last-resetCauses the system to display log messages generated since the last time the system was reset
- Examples
host1#baseline log 11:12:55 April 30 2002host1#baseline log last-resetThere is no no version. log destination
- Use to log messages to the specified destination, including system log, console, and nv-file (nonvolatile storage).
- Use the severity keyword to limit the messages logged based on priority level.
- The following information applies to logging messages to system log servers.
- You can have multiple system log servers, but must configure logging to each one separately.
- A particular message within a specified event category is logged to a particular system log server only if the priority of the message is greater than or equal to both the priority of the event category and the priority of that system log server.
- If you log messages to a system log server, you can also specify:
- facilitySpecifies a facility ID on the system log destination host. The range is 07, representing the logging facilities local0local7.
- includeLogs only the listed categories to system log; no other categories are logged unless specifically included by issuing this command again.
- excludeLogs all categories to system log except the listed categories; all other categories are logged unless specifically excluded by issuing this command again.
- Issuing an include command after an exclude command (or vice versa) overrides the earlier command. Therefore, you cannot enter a command including certain categories and then follow it with a command excluding others. Similarly, you cannot enter a command excluding certain categories and then follow it with a command including others.
- You can issue successive include commands or successive exclude commands; in this case, the successive commands expand the list of included or excluded categories.
- Example 1The first command causes only the osfpGeneral, mplsGeneral, and os event categories to be logged to system log at 10.10.9.5. The second command reverses this inclusion and restores the logging of all event categories.
host1(config)#log destination syslog 10.10.9.5 include ospfGeneral mplsGeneral oshost1(config)#no log destination syslog 10.10.9.5Example 2The first command again causes only the osfpGeneral, mplsGeneral, and os event categories to be logged to system log at 10.10.9.5. The second command reverses the inclusion of ospfGeneral and os. The mplsGeneral category is still included and is thus the only category logged. host1(config)#log destination syslog 10.10.9.5 include ospfGeneral mplsGeneral oshost1(config)#no log destination syslog 10.10.9.5 include ospfGeneral osExample 3The first command causes the isisGeneral, ipRoutePolicy, and ipTraffic event categories to be excluded from logging to system log at 10.1.2.3. The second command reverses this exclusion and restores the logging of all event categories. host1(config)#log destination syslog 10.1.2.3 exclude isisGeneral ipRoutePolicy ipTraffichost1(config)#no log destination syslog 10.1.2.3 excludeExample 4The first command again causes the isisGeneral, ipRoutePolicy, and ipTraffic event categories to be excluded from logging to system log at 10.1.2.3. The second command reverses the exclusion of ipRoutePolicy and ipTraffic. The isisGeneral category is still excluded; all other events are logged. host1(config)#log destination syslog 10.1.2.3 exclude isisGeneral ipRoutePolicy ipTraffichost1(config)#no log destination syslog 10.1.2.3 exclude isisGeneralExample 5The first command causes the isisGeneral event category to be excluded from logging to system log at 10.1.2.3. The second command causes ospfGeneral to also be excluded from logging. host1(config)#log destination syslog 10.1.2.3 exclude isisGeneralhost1(config)#log destination syslog 10.1.2.3 exclude ospfGeneralExample 6The first command causes the isisGeneral event category to be excluded from logging to system log at 10.1.2.3; all other events are logged. The second command overrides the first and causes the exclusion of all events except ospfGeneral. host1(config)#log destination syslog 10.1.2.3 exclude isisGeneralhost1(config)#log destination syslog 10.1.2.3 include ospfGeneralUse the no version to reverse the effects of previous commands or restore the default, which is to log all event categories. log destination syslog source
- Use to specify a source interface type and location for events logged to system log at the specified IP address.
- Overrides the actual source interface type and location. The IP address associated with the specified source interface is used as the source address for subsequent system log messages.
- Example
host1(config)#log destination syslog 10.1.2.3 source atm 0/1Use the no version to restore the actual source interface type and location. log engineering
- Use to enable engineering logs.
- Provides troubleshooting information to assist you when contacting Juniper Networks Technical Assistance Center (JTAC).
- Example
host1(config)#log engineeringUse the no form of this command to disable engineering logs. log fields
- Use to select fields to be added to all logs. These fields include a timestamp for the message, an instance identifier, and the name of the internal software application that created the message.
- Example
host1(config)#log fields timestamp instance no-calling-taskUse the no version to restore the default log field settings. log here
- Use to enable logs destined for a console to be displayed at the current console.
- By default, the local console automatically receives all log messages if console is a destination. The exception is the cliCommand log, whose log events do not appear on the console.
- By default, Telnet consoles do not receive log messages.
- Example
host1#log hereUse the no version to disable logs destined for a console from being displayed on this console. log severity
- Use to set the severity level for systemwide logs (that is, when you do not specify an individual event category) or for a specific event category. For a list of severity values, see Table 4.
- If you do not specify a category, the severity value changes for all categories except individual categories for which you previously set a specific severity level. See Configuring Log Severity for Individual and Systemwide Logs for details.
- Each event category has its own default severity value. For most categories, the default is Error.
- To disable all default level log messages, use the off keyword without specifying an event category.
- To disable individual level log messages, use the off keyword and specify the event category that you want to disable.
- Example
host1(config)#log severity warningUse the no version to return the systemwide (when assigned) or default severity values to event categories. Use the no version with an* (asterisk) to return all event categories (modified either systemwide or individually) to their default severity setting. For example: host1(config)#nolog severity *log unlimit
- Use to remove the limit on the number of outstanding buffers for an event category, such as when the system is dropping logs of a particular category.
- Example
host1(config)#log unlimit qosUse the no version to return to the default value. log verbosity
- Use to set the verbosity level for a selected category or for all categories.
- If you do not specify a category, then the verbosity level is set for all categories.
- The default verbosity setting for all logs is low.
- Example
host1(config)#log verbosity lowUse the no version to return to the default verbosity (low) for the selected category.