Use the logging on global configuration command to control error message logging. This command sends debug or error messages to a logging process, which logs messages to designated locations asynchronously with respect to the process that generated the messages. To disable the logging process, use the no form of this command.
Syntax
logging on
no logging on
Default Configuration
Logging is enabled.
Command Mode
Global Configuration Mode
User Guidelines
The logging process controls the distribution of logging messages to the various destinations, such as the logging buffer, logging file, or syslog server. Logging on and off for these destinations can be individually configured using the logging buffered, logging file, and logging global configuration commands. However, if the logging on command is disabled, no messages are sent to these destinations. Only the console receives messages.
Examples
The following example enables logging.
Console (config)# logging on
logging
Use the logging global configuration command to log messages to a syslog server. To delete the syslog server with the specified address from the list of syslogs, use the no form of this command.
ip-addressHost IP address used as a syslog server.
portPort number for syslog messages. If unspecified, the port number defaults to 514 (Range: 1-65535).
levelLimits the logging of messages to the syslog servers to a specified level: emergencies, alerts, critical, errors, warnings, notifications, informational and debugging. If unspecified, the level is errors.
facilityThe facility that is indicated in the message. Can be one of the following values: local0, local1, local2, local3, local4, local5, local 6, local7, and no-maps. If unspecified, the port number defaults to local7.
textSyslog server description.
Default Configuration
This command has no default configuration.
Command Mode
Global Configuration Mode
User Guidelines
Multiple syslog servers can be used.
If no specific severity level is specified, the global values apply to each server.
When the device is rebooted, the log is kept, even when logging is disabled.
Examples
The following example logs messages with a severity level critical to a syslog server with an IP address 10.1.1.1.
Use the logging console global configuration command to limit messages logged to the console based on severity. To disable logging to the console terminal, use the no form of this command.
Syntax
logging console level
no logging console
levelLimits the logging of messages displayed on the console to a specified level: emergencies, alerts, critical, errors, warnings, notifications, informational, debugging.
Default Configuration
The default is informational.
Command Mode
Global Configuration Mode
User Guidelines
All severities below the selected severity level are automatically selected.
Examples
The following example limits messages logged to the console to be based on the errors severity level.
Console (config)# logging console errors
logging buffered
Use the logging buffered global configuration command to limit syslog messages displayed from an internal buffer based on severity. To cancel buffer use, use the no form of this command.
Syntax
logging bufferedlevel
no logging buffered
levelLimits the message logging to a specified level buffer: emergencies, alerts, critical, errors, warnings, notifications, informational, debugging.
Default Configuration
The default level is informational.
Command Mode
Global Configuration Mode
User Guidelines
All the syslog messages are logged to the internal buffer. This command limits the commands displayed to the user.
Examples
The following example limits syslog messages displayed from an internal buffer based on the debugging severity level.
Console (config)# logging buffered debugging
logging buffered size
Use the logging buffered size global configuration command to set the number of syslog messages stored in the internal buffer. To return the number of messages stored in the internal buffer to the default value, use the no form of this command.
Syntax
logging buffered size number
no logging buffered size
numberNumeric value indicating the maximum number of messages stored in the history table (Range: 1-400).
Default Configuration
The default number of messages is 200.
Command Mode
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Examples
The following example changes the number of syslog messages stored in the internal buffer to 300.
Console (config)# logging buffered size 300
clear logging
Use the clear logging privileged EXEC command to clear messages from the internal logging buffer.
Syntax
clear logging
Default Configuration
This command has no default configuration.
Command Mode
Privileged EXEC Mode
User Guidelines
There are no user guidelines for this command.
Examples
The following example clears messages from the internal syslog message logging buffer.
Console# clear logging
Clear logging buffer [y/n]
Console#
logging file
Use the logging file global configuration command to limit syslog messages sent to the logging file based on severity. To cancel the buffer, use the no form of this command.
Syntax
logging filelevel
no logging file
levelLimits message logging to the buffer for a specified level, which includes one of the following: emergencies, alerts, critical, errors, warnings, notifications, informational and debugging.
Default Configuration
The default severity level is errors.
Command Mode
Global Configuration Mode
User Guidelines
There are no user guidelines for this command.
Examples
The following example limits syslog messages sent to the logging file based on the alerts severity level.
Console (config)# logging file alerts
clear logging file
Use the clear logging file privileged EXEC command to clear messages from the logging file.
Syntax
clear logging file
Default Configuration
This command has no default configuration.
Command Mode
Privileged EXEC Mode
User Guidelines
There are no user guidelines for this command.
Examples
The following example clears messages from the logging file.
Console# clear logging file
Clear logging file [y/n]
Erasing file syslog1............done
Console#
show logging
Use the show logging privileged EXEC command to display logging information and syslog messages stored in the internal logging buffer.
Syntax
show logging
Default Configuration
This command has no default configuration.
Command Mode
Privileged EXEC Mode
User Guidelines
There are no user guidelines for this command.
Examples
The following example displays logging information about the syslog messages stored in the internal logging buffer.
Offers subject to change, not combinable with all other offers. Taxes, shipping, handling and other fees apply. U.S. Dell Home and Home Office new purchases only. Dell reserves the right to cancel orders arising from pricing or other errors.