SystemPrivileged EXEC

clear logging

Clears the logging buffer on a Cisco IOS device, removing all syslog messages stored in memory, typically used to reset the log for troubleshooting or to free up buffer space.

Syntax·Privileged EXEC
clear logging

When to Use This Command

  • After troubleshooting a network issue, clear the logging buffer to start fresh for monitoring new events.
  • When the logging buffer is full and you need to free memory for new log entries.
  • Before performing a critical configuration change to ensure only new logs are captured for analysis.
  • To remove sensitive or outdated log entries before sharing the device output with a colleague.

Command Examples

Clear the logging buffer

clear logging
Clear logging buffer [confirm]

Router#

The command prompts for confirmation. Press Enter to confirm. After clearing, the buffer is empty and no output is shown.

Clear logging buffer with no confirmation (using 'yes')

clear logging
Clear logging buffer [confirm] y

Router#

Typing 'y' and pressing Enter bypasses the default confirmation. The buffer is cleared immediately.

Understanding the Output

The 'clear logging' command does not produce a detailed output; it simply prompts for confirmation. After execution, the logging buffer is emptied. To verify, use 'show logging' to see that the buffer is empty (e.g., 'Syslog logging: enabled (0 messages dropped, 0 messages rate-limited, 0 flushes, 0 overruns)'). In a real network, clearing the buffer is useful when you want to isolate new events without old messages cluttering the view.

CCNA Exam Tips

1.

CCNA exam tip: 'clear logging' only clears the buffer in RAM, not the syslog server logs if configured.

2.

CCNA exam tip: The command requires Privileged EXEC mode (enable).

3.

CCNA exam tip: After clearing, use 'show logging' to confirm the buffer is empty; exam may test the sequence.

4.

CCNA exam tip: 'clear logging' does not affect logging configuration; it only clears stored messages.

Common Mistakes

Mistake 1: Assuming 'clear logging' clears logs on a remote syslog server — it only clears the local buffer.

Mistake 2: Forgetting to confirm the prompt, leaving the command incomplete.

Mistake 3: Using 'clear logging' in User EXEC mode (>) instead of Privileged EXEC mode (#).

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions