How to Find xNIC Logs

Prev Next
WHAT TO EXPECT
In this article, you will learn how to find xNICs logs on your VM and how to alter its verbosity level.

swXtch.io Support may also request for you to send cloudSwXtch logs. For more information, see How to View cloudSwXtch Logs for Troubleshooting.

Locating xNIC Logs

An xNIC installed on a virtual machine creates one .log file per day with the following naming structure: swxtch-xnic-YYYYMMDD.log. If the file size exceeds the maximum within the same day (16MB), it will be renamed by adding a counter as a suffix. Then, a new file will be created.

To find your logs, use the following file paths: 

Windows

  • C:\Users\Public\swx\logs\xnic-control
  • C:\Users\Public\swx\logs\xnic-data

Linux

  • /var/log/swx/xnic-control
  • /var/log/swx/xnic-data

For Linux, logs can also be viewed by using either journalctl examples below: 

xnic-control

sudo journalctl -u swxtch-xnic-control -n 500 -f

xnic-data

sudo journalctl -u swxtch-xnic-data -n 500 -f

Please note: Standard journalctl arguments apply. The above examples use -n for number of lines and -f to follow. 

Log File Deletion
Log files older than 30 days are automatically deleted. 

What is verbosity?

Depending on the level of verbosity detailed in the xNIC config file, a log will contain different application messages and usage statistics. The default verbosity level after xNIC installation is 0, which means that no periodic statistics are being reported. It will only show start and stop information as well as critical errors.

A user can change the verbosity to pull more information out from their xNIC. The levels are detailed below: 

  • Level 0: Only show start and stop info as well as critical errors. This is the default. 
  • Level 1: Shows statistics and IGMP messages
  • Level 2: Additional control messages 
  • Level 3: Hexadecimal dumps of control/config packages
  • Level 4: Hexadecimal dumps of data packages

An average user would typically only need up to Level 2 for troubleshooting issues with their xNIC. 

Verbosity and File Size
Please note that increasing the verbosity level of future logs will result in larger file sizes. It is recommended to revert back to the default Level 0 when testing and troubleshooting is complete. 

How to Change Verbosity

To change the verbosity, a user can manually edit the xNIC config file on their VM.

For Windows: 

  1. Go to the Swxtch-xNIC folder on the VM you have an xNIC installed. Make sure it is the xNIC you want logs for. 
    1. C:\Program Files\SwXtch.io\Swxtch-xNICWindows-swx-xnic-folder
  2. Open the xnic.json file. 
  3. For xNIC-Data, change the number next to "verbosity" so that it matches the level you desire. The default is 0. 
  4. For xNIC-Control, modify the StatsReportWait to change the time in seconds of the report stats. xnic.json2
  5.  Save and Close the json file. 
  6.  Open "Task Manager" and go to the "Services" tab towards the top of the window. 
  7.  To apply changes from the json file, scroll down to "swXtchNIC-Control" and right-click on it.
  8.  Select"Restart." 
    1. Please note: Only xNIC-Control has to be restarted to update both control and data logs. Windows%20swx-xnic%20services

Your selection in verbosity will now be applied to future logs. This should only be changed if directed by swXtch.io and ensure that they are set back to default when troubleshooting is complete. 

For Linux: 

  1.  Enter the following command to view your config file in the Bash terminal. Make sure it is on the xNIC you want logs for.
    Text
    sudo nano /var/opt/swxtch/swxtch-xnic/swxtch-xnic.conf
    
  2. For xNIC-Data, change the number next to "verbose" so that it matches the level you desire. The default is 0. 
  3. For xNIC-Control, modify the StatsReportWait to change the time in seconds of the report stats. xnic.json-linux
  4.  Save and Exit the file. 
  5.  Restart your swxtch-xnic-control by using the following command. Please note: Only xNIC-Control has to be restarted to update both control and data logs. 
    Text
    sudo systemctl restart swxtch-xnic-control

    Your selection in verbosity will now be applied to future logs. This should only be changed if directed by swXtch.io and ensure that they are set back to default when troubleshooting is complete. 

PRO-TIP
Rename your existing log file before restarting the xNIC service in order to differentiate it with the freshly generated log file containing the new verbosity data.