Log Files with NVUE

NVUE provides commands to show the current system logging configuration, show the contents of the log files on the switch, and to delete log files.

Show System Logging Configuration

To show the current system log configuration on the switch, run the nv show system log command:

cumulus@switch:~$ nv show system log

Show System Log Files

To show the contents of the most current system log file, run the nv show system log file command. The contents are shown with the less command, which enables you to scroll through the file interactively. The less command is typically used to view the most recent log entries.

cumulus@switch:~$ nv show system log file

The nv show system log file command provides the following options:

Option Description
brief Shows the contents of the most current system log file but in a more concise format.
follow Shows the contents of a system log file in real-time. The command shows the log file output continuously as it is updated, similar to the behavior of the tail -f command.
list Shows the available system log files on the system with their filenames and corresponding file paths.
<file-name> Shows the contents of a specific system log file. If the file is a regular log file (such as syslog.1), the system uses less so that you can scroll and search through the log entries. If the file is compressed (such as syslog.2.gz), the system displays the contents without decompressing the file. This command is useful for viewing both archived and compressed log files.

The following example shows the contents of the most current system log file:

cumulus@switch:~$ nv show system log file

The following example shows the contents of the most current system log file in a more concise format:

cumulus@switch:~$ nv show system log file brief

The following example shows the contents of a system log file in real-time:

cumulus@switch:~$ nv show system log file follow

The following example shows the available system log files on the system with their filenames and corresponding file paths:

cumulus@switch:~$ nv show system log file list

The following example shows the contents of syslog.1

cumulus@switch:~$ nv show system log file syslog.1

Show Components Generating the Logs

To show the components of the system generating the logs and the log severity levels associated with each component, run the nv show system log component command.

cumulus@switch:~$ nv show system log component 
Component         Level 
----------------  ------ 
nvue             info  
orchagent         notice 
portsyncd         notice 
sai_api_port      notice 
sai_api_switch    notice 
symmetry-manager  info  
syncd             notice

The nv show system log component command provides the following options:

Option Description
<component-name> file Shows the contents of the most current file for a specific component. The system uses the less command so that you can scroll through the file interactively.
<component-name> file list Provides a list of log files for the specified component and shows the associated logs.
Component File List

The following example shows the contents of the most current file for NVUE:

cumulus@switch:~$ nv show system log component nvue file

The following example shows the log files and associated logs for NVUE:

cumulus@switch:~$ nv show system log component nvue file list 

Delete System Log Files

Deleting log files enables you to manage storage space and ensure that only relevant logs remain. You typically delete log files after you upload or archive them, or when you no longer need the logs for troubleshooting or auditing. Log file deletion is a crucial step in log management to ensure that outdated or irrelevant data does not occupy system resources.

To delete a log file, run the nv action delete system log file <file-name> command:

cumulus@switch:~$ nv action delete system log file mstpd.log 

To delete a log file from a specific system component, run the nv action delete system log component <component-name> file <file-name> command:

cumulus@switch:~$ nv action delete system log component nvue file nvued.log