39 Gathering system information and logs #
When a virtualization host encounters a problem, it is often necessary to
collect a detailed system report, which can be done with the help of the
supportconfig
tool. See
Kapitel 47, Erfassen der Systeminformationen für den Support
for more information about supportconfig
.
In certain cases, the information gathered by
supportconfig
is insufficient, and logs generated from a
custom logging or debugging configuration may be required to determine the
cause of a problem.
39.1 libvirt
log controls #
libvirt
provides logging facilities for both the library and the
daemon. The behavior of the logging facility is controlled by adjusting
the log level, filter and output settings.
- Log level
libvirt
log messages are classified into four priority levels: DEBUG, INFO, WARNING and ERROR. The DEBUG level is verbose and capable of generating gigabytes of information in a short time. The volume of log messages progressively decreases with the INFO, WARNING and ERROR log levels. ERROR is the default log level.- Log filters
Log filters provide a way to log only messages matching a specific component and log level. Log filters allow collecting the verbose DEBUG log messages of specific components, but only ERROR level log messages from the rest of the system. By default, no log filters are defined.
- Log outputs
Log outputs allow specifying where the filtered log messages are sent. Messages can be sent to a file, the standard error stream of the process, or journald. By default, filtered log messages are sent to journald.
See https://libvirt.org/logging.html for more
details on libvirt
's log controls.
A default libvirt
installation has the log level set to ERROR, no log
filters defined, and log outputs set to journald. Log messages from the
libvirt
daemon can be viewed with the journalctl
command:
#
journalctl --unit libvirtd
The default log facility settings are fine for normal operations and
provide useful messages for applications and users of libvirt
, but
internal issues often require DEBUG level messages. As an example,
consider a potential bug in the interaction between libvirt
and the
QEMU monitor. In this case, we only need to see the debug messages of
the communication between libvirt
and QEMU. The following example
creates a log filter to select debug messages from the QEMU driver and
send them to a file named /tmp/libvirtd.log
log_filters="1:qemu.qemu_monitor_json" log_outputs="1:file:/tmp/libvirtd.log"
Log controls for the libvirt
daemon can be found in
/etc/libvirt/libvirtd.conf
. The daemon must be
restarted after making any changes to the configuration file.
#
systemctl restart libvirtd.service