0% found this document useful (0 votes)
38 views12 pages

Timestamp

This document provides information and configuration instructions for system message logs on a switch. It discusses: - Default message logging settings that send output to the console - System message formats that include sequence numbers, timestamps, facilities, severities, and descriptions - Configuring message logging destinations like the console, logging buffer, and syslog server - Setting the syslog message history table size and limiting stored messages

Uploaded by

Vlad Serban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views12 pages

Timestamp

This document provides information and configuration instructions for system message logs on a switch. It discusses: - Default message logging settings that send output to the console - System message formats that include sequence numbers, timestamps, facilities, severities, and descriptions - Configuring message logging destinations like the console, logging buffer, and syslog server - Setting the syslog message history table size and limiting stored messages

Uploaded by

Vlad Serban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Configuring System Message Logs

• Information About Configuring System Message Logs, on page 1


• How to Configure System Message Logs, on page 3
• Monitoring and Maintaining System Message Logs, on page 11
• Configuration Examples for System Message Logs, on page 11
• Additional References for System Message Logs, on page 11
• Feature History and Information For System Message Logs, on page 12

Information About Configuring System Message Logs


System Messsage Logging
By default, a switch sends the output from system messages and debug privileged EXEC commands to a
logging process. . The logging process controls the distribution of logging messages to various destinations,
such as the logging buffer, terminal lines, or a UNIX syslog server, depending on your configuration. The
process also sends messages to the console.
When the logging process is disabled, messages are sent only to the console. The messages are sent as they
are generated, so message and debug output are interspersed with prompts or output from other commands.
Messages appear on the active consoles after the process that generated them has finished.
You can set the severity level of the messages to control the type of messages displayed on the consoles and
each of the destinations. You can time-stamp log messages or set the syslog source address to enhance real-time
debugging and management. For information on possible messages, see the system message guide for this
release.
You can access logged system messages by using the switch command-line interface (CLI) or by saving them
to a properly configured syslog server. The switch software saves syslog messages in an internal buffer on a
standalone switch. If a standalone switch , the log is lost unless you had saved it to flash memory.
You can remotely monitor system messages by viewing the logs on a syslog server or by accessing the switch
through Telnet, through the console port, or through the Ethernet management port.

Note The syslog format is compatible with 4.3 BSD UNIX.

Configuring System Message Logs


1
Configuring System Message Logs
System Log Message Format

System Log Message Format


System log messages can contain up to 80 characters and a percent sign (%), which follows the optional
sequence number or time-stamp information, if configured. Depending on the switch, messages appear in one
of these formats:
• seq no:timestamp: %facility-severity-MNEMONIC:description (hostname-n)
• seq no:timestamp: %facility-severity-MNEMONIC:description

The part of the message preceding the percent sign depends on the setting of these global configuration
commands:
• service sequence-numbers
• service timestamps log datetime
• service timestamps log datetime [localtime] [msec] [show-timezone]
• service timestamps log uptime

Table 1: System Log Message Elements

Element Description

seq no: Stamps log messages with a sequence number only if the service sequence-numbers
global configuration command is configured.

timestamp formats: Date and time of the message or event. This information appears only if the service
timestamps log [datetime | log] global configuration command is configured.
mm/dd h h:mm:ss
or
hh:mm:ss (short
uptime)
or
d h (long uptime)

facility The facility to which the message refers (for example, SNMP, SYS, and so forth).

severity Single-digit code from 0 to 7 that is the severity of the message.

MNEMONIC Text string that uniquely describes the message.

description Text string containing detailed information about the event being reported.

Default System Message Logging Settings


Table 2: Default System Message Logging Settings

Feature Default Setting

System message logging to the console Enabled.

Configuring System Message Logs


2
Configuring System Message Logs
Syslog Message Limits

Feature Default Setting

Console severity Debugging.

Logging file configuration No filename


specified.

Logging buffer size 4096 bytes.

Logging history size 1 message.

Time stamps Disabled.

Synchronous logging Disabled.

Logging server Disabled.

Syslog server IP address None configured.

Server facility Local7

Server severity Informational.

Syslog Message Limits


If you enabled syslog message traps to be sent to an SNMP network management station by using the
snmp-server enable trap global configuration command, you can change the level of messages sent and
stored in the switch history table. You also can change the number of messages that are stored in the history
table.
Messages are stored in the history table because SNMP traps are not guaranteed to reach their destination. By
default, one message of the level warning and numerically lower levels are stored in the history table even
if syslog traps are not enabled.
When the history table is full (it contains the maximum number of message entries specified with the logging
history size global configuration command), the oldest message entry is deleted from the table to allow the
new message entry to be stored.
The history table lists the level keywords and severity level. For SNMP usage, the severity level values increase
by 1. For example, emergencies equal 1, not 0, and critical equals 3, not 2.

How to Configure System Message Logs


Setting the Message Display Destination Device
If message logging is enabled, you can send messages to specific locations in addition to the console.
This task is optional.

Configuring System Message Logs


3
Configuring System Message Logs
Setting the Message Display Destination Device

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Device# configure terminal

Step 2 logging buffered [size] Logs messages to an internal buffer on the


switch. The range is 4096 to 2147483647 bytes.
Example:
The default buffer size is 4096 bytes.
Device(config)# logging buffered 8192 If a standalone switchfails, the log file is lost
unless you previously saved it to flash memory.
See Step 4.
Note Do not make the buffer size too large
because the switch could run out of
memory for other tasks. Use the
show memory privileged EXEC
command to view the free processor
memory on the switch. However,
this value is the maximum available,
and the buffer size should not be set
to this amount.

Step 3 logging host Logs messages to a UNIX syslog server host.


Example: host specifies the name or IP address of the host
to be used as the syslog server.
Device(config)# logging 125.1.1.100
To build a list of syslog servers that receive
logging messages, enter this command more
than once.

Step 4 end Returns to privileged EXEC mode.


Example:

Device(config)# end

Step 5 terminal monitor Logs messages to a nonconsole terminal during


the current session.
Example:
Terminal parameter-setting commands are set
Device# terminal monitor locally and do not remain in effect after the
session has ended. You must perform this step
for each session to see the debugging messages.

Configuring System Message Logs


4
Configuring System Message Logs
Synchronizing Log Messages

Synchronizing Log Messages


You can synchronize unsolicited messages and debug privileged EXEC command output with solicited device
output and prompts for a specific console port line or virtual terminal line. You can identify the types of
messages to be output asynchronously based on the level of severity. You can also configure the maximum
number of buffers for storing asynchronous messages for the terminal after which messages are dropped.
When synchronous logging of unsolicited messages and debug command output is enabled, unsolicited device
output appears on the console or printed after solicited device output appears or is printed. Unsolicited messages
and debug command output appears on the console after the prompt for user input is returned. Therefore,
unsolicited messages and debug command output are not interspersed with solicited device output and prompts.
After the unsolicited messages appear, the console again displays the user prompt.
This task is optional.

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Device# configure terminal

Step 2 line [console | vty] line-number Specifies the line to be configured for
[ending-line-number] synchronous logging of messages.
Example: • console —Specifies configurations that
occur through the switch console port or
Device(config)# line console the Ethernet management port.
• line vty line-number—Specifies which vty
lines are to have synchronous logging
enabled. You use a vty connection for
configurations that occur through a Telnet
session. The range of line numbers is from
0 to 15.

You can change the setting of all 16 vty lines


at once by entering:
line vty 0 15
You can also change the setting of the single
vty line being used for your current connection.
For example, to change the setting for vty line
2, enter:
line vty 2
When you enter this command, the mode
changes to line configuration.

Configuring System Message Logs


5
Configuring System Message Logs
Disabling Message Logging

Command or Action Purpose


Step 3 logging synchronous [level [severity-level | Enables synchronous logging of messages.
all] | limit number-of-buffers]
• (Optional) level severity-level—Specifies
Example: the message severity level. Messages with
a severity level equal to or higher than this
Device(config)# logging synchronous level value are printed asynchronously. Low
3 limit 1000 numbers mean greater severity and high
numbers mean lesser severity. The default
is 2.
• (Optional) level all—Specifies that all
messages are printed asynchronously
regardless of the severity level.
• (Optional) limit
number-of-buffers—Specifies the number
of buffers to be queued for the terminal
after which new messages are dropped.
The range is 0 to 2147483647. The default
is 20.

Step 4 end Returns to privileged EXEC mode.


Example:

Device(config)# end

Disabling Message Logging


Message logging is enabled by default. It must be enabled to send messages to any destination other than the
console. When enabled, log messages are sent to a logging process, which logs messages to designated locations
asynchronously to the processes that generated the messages.
Disabling the logging process can slow down the switch because a process must wait until the messages are
written to the console before continuing. When the logging process is disabled, messages appear on the console
as soon as they are produced, often appearing in the middle of command output.
The logging synchronous global configuration command also affects the display of messages to the console.
When this command is enabled, messages appear only after you press Return.
To reenable message logging after it has been disabled, use the logging on global configuration command.
This task is optional.

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Configuring System Message Logs


6
Configuring System Message Logs
Enabling and Disabling Time Stamps on Log Messages

Command or Action Purpose

Device# configure terminal

Step 2 no logging console Disables message logging.


Example:

Device(config)# no logging console

Step 3 end Returns to privileged EXEC mode.


Example:

Device(config)# end

Enabling and Disabling Time Stamps on Log Messages


By default, log messages are not time-stamped.
This task is optional.

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Device# configure terminal

Step 2 Use one of these commands: Enables log time stamps.


• service timestamps log uptime • log uptime—Enables time stamps on log
• service timestamps log datetime[msec | messages, showing the time since the
localtime | show-timezone] system was rebooted.
Example: • log datetime—Enables time stamps on log
Device(config)# service timestamps log messages. Depending on the options
uptime selected, the time stamp can include the
date, time in milliseconds relative to the
or local time zone, and the time zone name.
Device(config)# service timestamps log
datetime

Step 3 end Returns to privileged EXEC mode.


Example:

Configuring System Message Logs


7
Configuring System Message Logs
Enabling and Disabling Sequence Numbers in Log Messages

Command or Action Purpose

Device(config)# end

Enabling and Disabling Sequence Numbers in Log Messages


If there is more than one log message with the same time stamp, you can display messages with sequence
numbers to view these messages. By default, sequence numbers in log messages are not displayed.
This task is optional.

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Device# configure terminal

Step 2 service sequence-numbers Enables sequence numbers.


Example:

Device(config)# service sequence-numbers

Step 3 end Returns to privileged EXEC mode.


Example:

Device(config)# end

Defining the Message Severity Level


Limit messages displayed to the selected device by specifying the severity level of the message.
This task is optional.

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Device# configure terminal

Configuring System Message Logs


8
Configuring System Message Logs
Limiting Syslog Messages Sent to the History Table and to SNMP

Command or Action Purpose


Step 2 logging console level Limits messages logged to the console.
Example: By default, the console receives debugging
messages and numerically lower levels.
Device(config)# logging console 3

Step 3 logging monitor level Limits messages logged to the terminal lines.
Example: By default, the terminal receives debugging
messages and numerically lower levels.
Device(config)# logging monitor 3

Step 4 logging trap level Limits messages logged to the syslog servers.
Example: By default, syslog servers receive informational
messages and numerically lower levels.
Device(config)# logging trap 3

Step 5 end Returns to privileged EXEC mode.


Example:

Device(config)# end

Limiting Syslog Messages Sent to the History Table and to SNMP


This task explains how to limit syslog messages that are sent to the history table and to SNMP.
This task is optional.

Procedure

Command or Action Purpose


Step 1 configure terminal Enters global configuration mode.
Example:

Device# configure terminal

Step 2 logging history level Changes the default level of syslog messages
stored in the history file and sent to the SNMP
Example:
server.
Device(config)# logging history 3 By default, warnings, errors, critical, alerts,
and emergencies messages are sent.

Step 3 logging history size number Specifies the number of syslog messages that
can be stored in the history table.
Example:

Configuring System Message Logs


9
Configuring System Message Logs
Logging Messages to a UNIX Syslog Daemon

Command or Action Purpose


The default is to store one message. The range
Device(config)# logging history size 200
is 0 to 500 messages.

Step 4 end Returns to privileged EXEC mode.


Example:

Device(config)# end

Logging Messages to a UNIX Syslog Daemon


This task is optional.

Note Some recent versions of UNIX syslog daemons no longer accept by default syslog packets from the network.
If this is the case with your system, use the UNIX man syslogd command to decide what options must be
added to or removed from the syslog command line to enable logging of remote syslog messages.

Before you begin


• Log in as root.
• Before you can send system log messages to a UNIX syslog server, you must configure the syslog daemon
on a UNIX server.

Procedure

Command or Action Purpose


Step 1 Add a line to the file /etc/syslog.conf. • local7—Specifies the logging facility.
Example: • debug—Specifies the syslog level. The
file must already exist, and the syslog
local7.debug /usr/adm/logs/cisco.log daemon must have permission to write to
it.

Step 2 Enter these commands at the UNIX shell Creates the log file. The syslog daemon sends
prompt. messages at this level or at a more severe level
to this file.
Example:

$ touch /var/log/cisco.log
$ chmod 666 /var/log/cisco.log

Configuring System Message Logs


10
Configuring System Message Logs
Monitoring and Maintaining System Message Logs

Command or Action Purpose


Step 3 Make sure the syslog daemon reads the new For more information, see the man syslog.conf
changes. and man syslogd commands on your UNIX
system.
Example:

$ kill -HUP `cat /etc/syslog.pid`

Monitoring and Maintaining System Message Logs


Monitoring Configuration Archive Logs
Command Purpose

show archive log config {all | number Displays the entire configuration log or the log for specified
[end-number] | user username [session parameters.
number] number [end-number] | statistics}
[provisioning]

Configuration Examples for System Message Logs


Example: Switch System Message
This example shows a partial switch system message on a switch:

00:00:46: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up


00:00:47: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
00:00:47: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to up
00:00:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
00:00:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state
to down 2
*Mar 1 18:46:11: %SYS-5-CONFIG_I: Configured from console by vty2 (10.34.195.36)
18:47:02: %SYS-5-CONFIG_I: Configured from console by vty2 (10.34.195.36)
*Mar 1 18:48:50.483 UTC: %SYS-5-CONFIG_I: Configured from console by vty2 (10.34.195.36)

Additional References for System Message Logs


Related Documents

Related Topic Document Title


For complete syntax and usage information for the Command Reference (Catalyst 9400 Series
commands used in this chapter. Switches)

Configuring System Message Logs


11
Configuring System Message Logs
Feature History and Information For System Message Logs

Feature History and Information For System Message Logs


Release Modification

Cisco IOS XE Everest 16.6.1 This feature was introduced.

Configuring System Message Logs


12

You might also like