Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Logging in Open vSwitch

September 27, 2016
Flavio Bruno Leitner

    Open vSwitch (OVS) is a virtual switch used in production from small to large scale deployments. It is designed to provide network automation along with support for a number of management interfaces and protocols.

    However, the developer or the administrator might need to understand more of what is going on under the hoods and OVS does a good job providing a very good logging facility which is the subject of this article.

    Editor's note: Red Hat Knowledgebase - "What Red Hat products provide support for Open vSwitch?"

    Introduction

    The OVS logging facility provides not only flexibility but granularity as well. Different from other software packages that you have a single logging output and a set of few message levels, OVS provides control over three possible outputs and message levels per module. It comes ready out-of-box and it can be controlled at runtime.

    Controlling the outputs

    One common scenario is to log to a file. The ovs-vswitchd(8) accepts the option --log-file[=file] to enable logging to a specific file. The file argument is actually optional, so if it is specified, it is used as the exact name for the log file. The default is used if file is not specified. Usually the default is /var/log/openvswitch/ovs-vswitch.log but it can change depending on compile time options. The correct information is available in the man-page.

    Another common scenario is to log to syslog. The ovs-vswitchd(8) provides an option to specify a remote syslog server (--syslog-target=host:port) and an option to specify the method to be used (--syslog-method) which can be libc syslog(), unix:file or udp:ip:port.

    The last method is the console output. It doesn't require specific configuration parameters. However, logging to console will have no effect if --detach is used because ovs-vswitchd will close its standard file descriptors.

    Controlling the logging levels

    Usually increasing log level is a concern on production environments because it can cause undesired side effects. OVS has internal modules and the logging facility is capable of setting specific message levels for each of them. This granularity helps to reduce the overall impact and in turn enables its usage in production.

    The list of modules can change for different reasons, so use the command below to see the list of available modules at runtime.

    # ovs-appctl vlog/list
                     console    syslog    file
                     -------    ------    ------
    backtrace          OFF        ERR       INFO
    bfd                OFF        ERR       INFO
    bond               OFF        ERR       INFO
    bridge             OFF        ERR       INFO
    bundle             OFF        ERR       INFO
    bundles            OFF        ERR       INFO
    cfm                OFF        ERR       INFO
    collectors         OFF        ERR       INFO
    command_line       OFF        ERR       INFO
    connmgr            OFF        ERR       INFO
    conntrack          OFF        ERR       INFO
    ...
    

    The list above is far from being complete because for example OVS 2.5 provides more than 90 modules. The screenshot above shows four columns. The module's name used in the commands is in the first column, the second column is the minimum message level required for the message to be sent on console output. The third column is the same but for syslog output and the last column controls the file log output.

    The logging levels can be off, emer, err, warn, info or dbg. Messages of the given severity or higher will be logged while others will be filtered out.

    Those levels can be set using command line parameter --verbose=[spec] where the argument can set a level for everything, or to specific output, or even to specific module on specific output. Using the command line is specially useful to debug during the initialization, otherwise the levels can be easily modified at runtime.

    The levels for each output can be modified using -v<output>:<level> syntax where the <output> is either console, syslog or file. For example, -vconsole:emer would set the minimum required log level to be emer.

    The defaults usually are -vconsole:emer -vsyslog:err -vfile:info.

    What about runtime? There is a tool called ovs-appctl(8) to manage logging. Actually the 'vlog' is the only subcommand documented in its man-page because other subcommands are registered during initialization of the modules. Anyway, this is probably a topic for another future blog post maybe.

    Coming back to ovs-appctl, there is the vlog/list to list the modules and their levels for each output as shown already. And there is the vlog/set to manage the list. See below some interesting examples with outputs.

    This is an example setting all modules on all output to dbg.
    # ovs-appctl vlog/set dbg
    # ovs-appctl vlog/list | head -n 10
                     console    syslog    file
                     -------    ------    ------
    backtrace          DBG        DBG        DBG
    bfd                DBG        DBG        DBG
    bond               DBG        DBG        DBG
    bridge             DBG        DBG        DBG
    bundle             DBG        DBG        DBG
    bundles            DBG        DBG        DBG
    cfm                DBG        DBG        DBG
    collectors         DBG        DBG        DBG
    
    
    This is an example of turning off all messages to console.
    # ovs-appctl vlog/set console:off
    # ovs-appctl vlog/list | head -n 10
                     console    syslog    file
                     -------    ------    ------
    backtrace          OFF        DBG        DBG
    bfd                OFF        DBG        DBG
    bond               OFF        DBG        DBG
    bridge             OFF        DBG        DBG
    bundle             OFF        DBG        DBG
    bundles            OFF        DBG        DBG
    cfm                OFF        DBG        DBG
    collectors         OFF        DBG        DBG
    
    
    This example sets cfm module logging level to emer only for
    the console output.
    # ovs-appctl vlog/set console:cfm:emer
    # ovs-appctl vlog/list | head -n 10
                     console    syslog    file
                     -------    ------    ------
    backtrace          OFF        DBG        DBG
    bfd                OFF        DBG        DBG
    bond               OFF        DBG        DBG
    bridge             OFF        DBG        DBG
    bundle             OFF        DBG        DBG
    bundles            OFF        DBG        DBG
    cfm               EMER        DBG        DBG
    collectors         OFF        DBG        DBG
    
    The tool accepts multiple arguments so the following example
    changes cfm log level for different outputs at the same time.
    # ovs-appctl vlog/set console:cfm:emer syslog:cfm:info file:cfm:off
    # ovs-appctl vlog/list | grep cfm
    cfm               EMER       INFO        OFF
    

    There is more. The tool ovs-appctl provides things like changing the log pattern, or reopen the file log, or change the syslog facility (RFC5424). The reader can find the details in the tool's man-page.

    Conclusion

    OVS is more than a simple virtual switch. It is programmable and has many features built-in. The fact that OVS provides a great deal of flexibility and granularity managing logging helps to support it, specially in production environments.

    Recent Posts

    • Best Practice Configuration and Tuning for Linux and Windows VMs

    • Red Hat UBI 8 builders have been promoted to the Paketo Buildpacks organization

    • Using eBPF in Red Hat products

    • How we made one data layer serve the UI, the mocks, and the E2E tests

    • Build trusted Python containers with Project Hummingbird and Calunga

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility