[libvirt] [PATCH 2/4] libvirtd.conf: Document that we do a 'first' match on log filters

Erik Skultety posted 4 patches 7 years, 1 month ago
[libvirt] [PATCH 2/4] libvirtd.conf: Document that we do a 'first' match on log filters
Posted by Erik Skultety 7 years, 1 month ago
When applying the log filters, one has to define the more specific
filters before the generic ones, because the first filter that matches
will be applied. However, we've been missing this information in the
config, so it always has been a trial-error scenario figuring out that
e.g. '4:util 1:util.pci' doesn't actually enable verbose logging on the
src/util/virpci.c module because 4:util will be matched first.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
---
 src/remote/libvirtd.conf | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/remote/libvirtd.conf b/src/remote/libvirtd.conf
index 4aed7e746..9c0080dc0 100644
--- a/src/remote/libvirtd.conf
+++ b/src/remote/libvirtd.conf
@@ -366,7 +366,9 @@
 #    4: ERROR
 #
 # Multiple filters can be defined in a single @filters, they just need to be
-# separated by spaces.
+# separated by spaces. Note that libvirt performs "first" match, i.e. if
+# there are concurrent filters, the first one that matches will be applied,
+# given the order in log_filters.
 #
 # e.g. to only get warning or errors from the remote layer and only errors
 # from the event layer:
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/4] libvirtd.conf: Document that we do a 'first' match on log filters
Posted by Ján Tomko 7 years, 1 month ago
On Tue, Apr 03, 2018 at 10:45:47AM +0200, Erik Skultety wrote:
>When applying the log filters, one has to define the more specific
>filters before the generic ones, because the first filter that matches
>will be applied. However, we've been missing this information in the
>config, so it always has been a trial-error scenario figuring out that
>e.g. '4:util 1:util.pci' doesn't actually enable verbose logging on the
>src/util/virpci.c module because 4:util will be matched first.
>
>Signed-off-by: Erik Skultety <eskultet@redhat.com>
>---
> src/remote/libvirtd.conf | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>

ACK

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list