| 5.3 |  | Monitoring with Logging and Syslog |
| 5.3.7 |  | Logging to a server |

| There are several basic commands used to configure the logging process. The logging host command identifies a syslog server host to receive logging messages. The ip-address or host-name arguments are the name or Internet address of the host. By issuing this command more than once, administrators can build a list of syslog servers that receive logging messages.

The logging facility command configures the syslog facility in which error messages are sent. The syslog facility helps identify the process or device that generated the log message. To revert to the default of local7, use the no form of this command.

The logging source-interface command sets all syslog messages to contain the same IP address, regardless of which interface they use. By default, a syslog message contains the IP address of the interface it uses to leave the router.

Message logging is enabled by default. When logging is enabled, the router sends debug or error messages to a logging process, which logs messages to designated locations. It must be enabled in order to send messages to any destination other than the console. To disable message logging, use the no logging on command. Note that disabling the logging process can slow down the router because a process cannot continue until the messages are written to the console. To re-enable message logging after it has been disabled, use the logging on command.

Using the commands shown in Figure , the number of messages displayed can be limited to the selected device by specifying the severity level of the error message.
Figure shows an example of configuring the sending of logging messages to three different destinations: internal buffer, console, and a syslog server.

The logging synchronous command is used to prevent syslog messages (unsolicited messages) and debug output from interrupting when actively typing commands in privileged EXEC or configuration mode. Instead of the line messages being intermingled with the input and the resultant display, the input is redisplayed on a single line at the end of each message that would interrupt the input. This makes reading the input and the message much easier. Figure demonstrates how to enter this command for console line 0.

After configuring logging, verify the configuration using the show running-config command.

Figure shows commands useful for troubleshooting and displaying logging information on a router. Figure shows an example of the show logging command.
The show logging privileged EXEC command displays currently configured logging parameters and the messages that are logged in the buffer. The first message displayed is the oldest message in the buffer. Figure describes the significant fields shown in the show logging example.