Chapter 39. Introduction to NetworkManager Debugging

Increasing the log levels for all or certain domains helps to log more details of the operations NetworkManager performs. Administrators can use this information to troubleshoot problems. NetworkManager provides different levels and domains to produce logging information. The /etc/NetworkManager/NetworkManager.conf file is the main configuration file for NetworkManager. The logs are stored in the journal.

This section provides information on enabling debug logging for NetworkManager and using different logging levels and domains to configure the amount of logging details.

39.1. Debugging levels and domains

You can use the levels and domains parameters to manage the debugging for NetworkManager. The level defines the verbosity level, whereas the domains define the category of the messages to record the logs with given severity (level).

Log levelsDescription

OFF

Does not log any messages about NetworkManager

ERR

Logs only critical errors

WARN

Logs warnings that can reflect the operation

INFO

Logs various informational messages that are useful for tracking state and operations

DEBUG

Enables verbose logging for debugging purposes

TRACE

Enables more verbose logging than the DEBUG level

Note that subsequent levels log all messages from earlier levels. For example, setting the log level to INFO also logs messages contained in the ERR and WARN log level.

Additional resources

  • For details on domains, refer to the NetworkManager.conf(5) man page.

39.2. Setting the NetworkManager log level

By default, all the log domains are set to record the INFO log level. Disable rate-limiting before collecting debug logs. With rate-limiting, systemd-journald drops messages if there are too many of them in a short time. This can occur when the log level is TRACE.

This procedure disables rate-limiting and enables recording debug logs for the all (ALL) domains.

Procedure

  1. To disable rate-limiting, edit the /etc/systemd/journald.conf file, uncomment the RateLimitBurst parameter in the [Journal] section, and set its value as 0:

    RateLimitBurst=0
  2. Restart the systemd-journald service.

    # systemctl restart systemd-journald
  3. Create the /etc/NetworkManager/conf.d/95-nm-debug.conf file with the following content:

    [logging]
    domains=ALL:DEBUG

    The domains parameter can contain multiple comma-separated domain:level pairs.

  4. Restart the NetworkManager service.

    # systemctl restart NetworkManager

39.3. Temporarily setting log levels at run time using nmcli

You can change the log level at run time using nmcli. However, Red Hat recommends to enable debugging using configuration files and restart NetworkManager. Updating debugging levels and domains using the .conf file helps to debug boot issues and captures all the logs from the initial state.

Procedure

  1. Optional: Display the current logging settings:

    # nmcli general logging
      LEVEL  DOMAINS
      INFO   PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,A
    UTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,
    WIMAX,INFINIBAND,FIREWALL,ADSL,BOND,VLAN,BRIDGE,DBUS_PROPS,TEAM,CONCHECK,DC
    B,DISPATCH
  2. To modify the logging level and domains, use the following options:

    • To set the log level for all domains to the same LEVEL, enter:

      # nmcli general logging level LEVEL domains ALL
    • To change the level for specific domains, enter:

      # nmcli general logging level LEVEL domains DOMAINS

      Note that updating the logging level using this command disables logging for all the other domains.

    • To change the level of specific domains and preserve the level of all other domains, enter:

      # nmcli general logging level KEEP domains DOMAIN:LEVEL,DOMAIN:LEVEL

39.4. Viewing NetworkManager logs

You can view the NetworkManager logs for troubleshooting.

Procedure

  • To view the logs, enter:

    # journalctl -u NetworkManager -b

Additional resources

  • The NetworkManager.conf(5) man page
  • The journalctl man page