From nobody Mon Feb 9 03:30:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642434230; cv=none; d=zohomail.com; s=zohoarc; b=PwpYovkjj7c2HWl/itT13n/gkpgHgO+LcEsxkfYP2Ze1wU1rGOvy4VLu2FlbgZhy0HiwLd5xAyDspMltmO+Pomy2WjVL+spjgZRPzT10XfYi801B8EP5fz2F9sMCtNrdcoYs4EKZW3fHpKJ4L5R8Stwigbq6iFfvjJfBKuRDtLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642434230; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XElS8Tx8eY/VaPCHt3Ii9dKu/newJ3/Ai97NAIu26Qk=; b=BfGqFIgUwoZ3Q6mcu4kcNBF1eW8uqvoK0kc4g5yz13xFLLvMJbUD8N5T5iYFDeM1kzBk7+nj8usbO8Ck6XVograjMdV5TEkZ4jynREov3cV4XMAU52fPKkbEJeJOkmkNEWPzVKl2VgHKU96OVxVC5b3rx6R0UX6SqllrtSbD9QY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1642434230824266.1449149771935; Mon, 17 Jan 2022 07:43:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-548-9pG5nO0jPFe8NdjpTP0JXQ-1; Mon, 17 Jan 2022 10:42:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9B708189CF; Mon, 17 Jan 2022 15:41:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77A652B4D2; Mon, 17 Jan 2022 15:41:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4367C4BB7C; Mon, 17 Jan 2022 15:41:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20HFdXKU000516 for ; Mon, 17 Jan 2022 10:39:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id C6E025B920; Mon, 17 Jan 2022 15:39:33 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 280545444C for ; Mon, 17 Jan 2022 15:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642434229; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XElS8Tx8eY/VaPCHt3Ii9dKu/newJ3/Ai97NAIu26Qk=; b=aoXCYtMjASGMWdpkh8FpJCDAoQQwQnRaGo9b3LeRQEoK/unJomV0F+g7Z4XSG3clcE+0RP nqd7XqzVxscnUOvJqnMv+vS02JX8Z4E5W9CELllvKUIN7vRDSK2i4aHwbqCSMzVuzQtcSs viLo9QPw2Dyc3G2adZuMbuH+RgTXMJk= X-MC-Unique: 9pG5nO0jPFe8NdjpTP0JXQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/8] kbase: debuglogs: Add a section describing log outputs and filters Date: Mon, 17 Jan 2022 16:39:13 +0100 Message-Id: <22f4867d164160a7b39c24629caa1038158a79e5.1642433476.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642434232490100001 Content-Type: text/plain; charset="utf-8" Outline what the given settings influence. Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- docs/kbase/debuglogs.rst | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/docs/kbase/debuglogs.rst b/docs/kbase/debuglogs.rst index cba57e020d..9ba39b9f85 100644 --- a/docs/kbase/debuglogs.rst +++ b/docs/kbase/debuglogs.rst @@ -17,6 +17,73 @@ Moreover, libvirt catches stderr of all running domains.= These can be useful as well. +Logging settings in libvirt +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + +Log levels +---------- + +Libvirt produces log entries in 4 priority levels; higher priority level m= eaning +more severe log entries, which in turn means less of them. The log level a= re +used by `Log outputs`_ and `Log filters`_ below): + + * ``1: DEBUG`` + * ``2: INFO`` + * ``3: WARNING`` + * ``4: ERROR`` + +For debugging it's necessary to capture ``DEBUG`` level entries as the name +implies. + +Log outputs +----------- + +Log outputs describe where the log messages are being recorded. The outputs +are described by a space-separated list of tuples in the following format: + +:: + + level:output + +``level`` refers to the minimum priority level of entries recorded in the = output. + +``output`` is one of the following: + + ``file:FILENAME`` + Logging messages are appended to FILENAME. + + ``journald`` + Logging goes to the ``journald`` logging daemon. + + ``stderr`` + Logging goes to the standard error output stream of the libvirt daemon. + + ``syslog:name`` + Logging goes to syslogd. ``name`` is used to identify the entries. + +The default output on systems running ``journald`` is ``3:journald``. Note= that +``journald`` can trottle the amount of logs per process so for capturing d= ebug +logs of libvirt daemons a file output should be used in addition to the ou= tput +to the logging daemon e.g.: + +:: + + "1:file:/var/log/libvirt/libvirtd.log 3:journald" + + +Log filters +----------- + +Log filters allow to avoid logging of messages which are not relevant to t= he +cause. The log filters is a space-separated list of tuples in the format +``level:identifer`` and limits messages which match ``identifier`` to the +configured log level. Identifier supports globbing patterns such as ``*``. + +As ``identifier`` is based on internal naming of modules, the best approac= h is +to select one of `Example filter settings`_. It's also always better to ha= ve +more information than lack something important. + + How to turn on debug logs for libvirt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.34.1