How to enable the log feature of open vswitch for debugging and troubleshooting

Source: Internet
Author: User
Tags syslog

Open VSwitch (OVS) is the most popular open-source virtual switch on the Linux platform. Because today's data centers are increasingly reliant on software-defined Networking (SDN) architectures, OvS is rapidly being used as a network element in the fact standard of the data center SDN deployment.

Open VSwitch has a built-in logging mechanism, which is called vlog. The Vlog tool allows you to enable and customize logs in various network switching components, and the log information generated by Vlog can be sent to a console, syslog, and a separate log file for easy viewing. You can dynamically configure the OvS log at run time by using a command-line tool called Ovs-appctl.

Here's how you can use Ovs-appctl to enable the logging feature in open vswitch and customize it.

The following is the syntax for OVS-APPCTL custom vlog.

$ sudo ovs-appctl Vlog/setmodule[:facility[:level]]

Module : The name of any legitimate component in the OvS (such as Netdev,ofproto,dpif,vswitchd, and so on)

Facility : The destination of the log information (must be: console,syslog, or file)

Level : The verbosity of the log (must be: Emer,err,warn,info, or DBG)

In the OvS source code, the module name is defined in the source file in the following format:

Vlog_define_this_module (<module-name>);

For example, in lib/netdev.c, you can see:

Vlog_define_this_module (Netdev);

This indicates that LIB/NETDEV.C is part of the Netdev module, and any log information generated in LIB/NETDEV.C will belong to the Netdev module.

In the OvS source code, multiple severity levels are used to define several different types of log information: Vloginfo () for reporting, Vlogwarn () for Warning, vlogerr () for error prompting, vlogdbg () for debugging information, Vlog_ The Emerg is used in emergency situations. Log levels and tools determine which log information is sent to where.

To view a complete list of available modules, tools, and their respective log levels, run the following command. The command must be called after you start OvS.

$ sudo ovs-appctl vlog/list

The output shows the debug level of each module used in three occasions (Facility:console,syslog,file). By default, the log level for all modules is set to info.

By specifying any one of the OvS modules, you can selectively modify the debug level for any particular occasion. For example, if you want to view dpif more detailed debugging information in the console screen, you can run the following command.

$ sudo ovs-appctl vlog/setdpif:console:dbg

You will see that the console tool for the DPIF module has changed its log level to DBG, while the other two occasions the log level of syslog and file remains unchanged.

If you want to modify the log level for all modules, you can specify "any" as the module name. For example, the following command modifies the log level for each module's console to DBG.

$ sudo ovs-appctl vlog/setany:console:dbg

Also, if you want to modify the log level for all three occasions at once, you can specify "any" as the occasion name. For example, the following command modifies the log level of each module to DBG for all occasions.

$ sudo ovs-appctl vlog/setany:any:dbg

free pick up brother even it education original Cloud Computing Training video/Detailed Linux tutorials, details of the website customer service: http://www.lampbrother.net/linux/or hooking up q2430675018~

Welcome to the Linux Communication Group 478068715


How to enable the log feature of open vswitch for debugging and troubleshooting

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.