Skip to contentSkip to conversation

libxl: open libxl log stream with libvirtd log_level

PATCH Ian Campbell 4 participants 8 messages Sep 15, 2015 – Nov 11, 2015 7 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ian Campbell

author Acked-by
#1 lore raw
Quoted 8 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

FWIW this seems like a good idea to me:

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 15 lines · Daniel P. Berrange
Quoted 7 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

Quoted 5 lines
---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Quoted 4 lines

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

I had actually thought of adding it there first, but then took this approach assuming it would be more receptive upstream :-). Personally, I'm on the fence. I like the idea of a single knob to control log level throughout the daemon, making it a bit easier on admins. On the other hand, individual knobs are more friendly to those pouring through logs. I can add a knob in libxl.conf if preferred.

Regards,
Jim

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 21 lines · Jim Fehlig
Quoted 15 lines · Daniel P. Berrange
Quoted 7 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

Quoted 5 lines
---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Quoted 4 lines

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

Quoted 6 lines

I had actually thought of adding it there first, but then took this approach assuming it would be more receptive upstream :-). Personally, I'm on the fence. I like the idea of a single knob to control log level throughout the daemon, making it a bit easier on admins. On the other hand, individual knobs are more friendly to those pouring through logs. I can add a knob in libxl.conf if preferred.

After thinking about it some more, I could actually see value in create a dedicated virLogSource() instance, solely for libxl library messages. If we then created a virLogSourceGetPriority() method, you could query that to see if to turn on logging for the libxl library. That would ultimately allow you to turn on debug for just the libxl library if desired, eg

static virLogSource virLogLibXL = {
.name = "libxl.libxl_library",
....
}

LIBVIRT_LOG_FILTERS="1:libxl_library"

Regardless we should just merge your current patch right now.

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 40 lines · Daniel P. Berrange
Quoted 23 lines · Jim Fehlig
Quoted 16 lines · Daniel P. Berrange
Quoted 7 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

Quoted 6 lines
---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Quoted 5 lines

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

Quoted 7 lines

I had actually thought of adding it there first, but then took this approach assuming it would be more receptive upstream :-). Personally, I'm on the fence. I like the idea of a single knob to control log level throughout the daemon, making it a bit easier on admins. On the other hand, individual knobs are more friendly to those pouring through logs. I can add a knob in libxl.conf if preferred.

After thinking about it some more, I could actually see value in create a dedicated virLogSource() instance, solely for libxl library messages. If we then created a virLogSourceGetPriority() method, you could query that to see if to turn on logging for the libxl library. That would ultimately allow you to turn on debug for just the libxl library if desired, eg

Quoted 7 lines

static virLogSource virLogLibXL = {
.name = "libxl.libxl_library",
....
}

LIBVIRT_LOG_FILTERS="1:libxl_library"

Ah, good idea. I'll look into it.

Quoted 2 lines

Regardless we should just merge your current patch right now.

Thanks; done now.

Regards,
Jim

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 46 lines · Jim Fehlig
Quoted 45 lines · Daniel P. Berrange
Quoted 23 lines · Jim Fehlig
Quoted 16 lines · Daniel P. Berrange
Quoted 7 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

Quoted 6 lines
---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Quoted 5 lines

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

Quoted 7 lines

I had actually thought of adding it there first, but then took this approach assuming it would be more receptive upstream :-). Personally, I'm on the fence. I like the idea of a single knob to control log level throughout the daemon, making it a bit easier on admins. On the other hand, individual knobs are more friendly to those pouring through logs. I can add a knob in libxl.conf if preferred.

After thinking about it some more, I could actually see value in create a dedicated virLogSource() instance, solely for libxl library messages. If we then created a virLogSourceGetPriority() method, you could query that to see if to turn on logging for the libxl library. That would ultimately allow you to turn on debug for just the libxl library if desired, eg

static virLogSource virLogLibXL = {
.name = "libxl.libxl_library",
....
}

Quoted 4 lines
Quoted 2 lines

LIBVIRT_LOG_FILTERS="1:libxl_library"

Ah, good idea. I'll look into it.

Is it done anywhere? If not, how can I help?

This the above change (setting libxl log level to libvirtd global one), makes almost impossible to get libxl debug, because the rest of libvirtd trashes the logs (hundreds virEvent* and virObject* messages, at "info"(!) level).

Signature · 5 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): 20151111155759.GI17091@mail-itl

#12 lore raw
Quoted 50 lines · Marek Marczykowski-Górecki
Quoted 49 lines · Jim Fehlig
Quoted 47 lines · Daniel P. Berrange
Quoted 23 lines · Jim Fehlig
Quoted 16 lines · Daniel P. Berrange
Quoted 7 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

Quoted 6 lines
---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Quoted 5 lines

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

Quoted 7 lines

I had actually thought of adding it there first, but then took this approach assuming it would be more receptive upstream :-). Personally, I'm on the fence. I like the idea of a single knob to control log level throughout the daemon, making it a bit easier on admins. On the other hand, individual knobs are more friendly to those pouring through logs. I can add a knob in libxl.conf if preferred.

After thinking about it some more, I could actually see value in create a dedicated virLogSource() instance, solely for libxl library messages. If we then created a virLogSourceGetPriority() method, you could query that to see if to turn on logging for the libxl library. That would ultimately allow you to turn on debug for just the libxl library if desired, eg

static virLogSource virLogLibXL = {
.name = "libxl.libxl_library",
....
}

LIBVIRT_LOG_FILTERS="1:libxl_library"

Quoted 8 lines
Quoted 1 line

Ah, good idea. I'll look into it.

Is it done anywhere? If not, how can I help?

This the above change (setting libxl log level to libvirtd global one), makes almost impossible to get libxl debug, because the rest of libvirtd trashes the logs (hundreds virEvent* and virObject* messages, at "info"(!) level).

Presumably that's because you are using LIBVIRT_DEBUG=1 or setting log_debug=1 in /etc/libvirt/libvirtd.log. That is generally discouraged because it turns on all logging, which is essentially unusably verbose.

It is also better to use more specific log settings, eg when I debug the QEMU driver I usually use

log_filters="1:qemu 1:security 3:event 3:object 1:util" log_outputs="1:file:/var/log/libvirt/libvirtd.log"

This generates log messages from every source file in qemu and security directories, and also log messages from every file in the util/ directory *except* for event & object files. So it is much more managable to read.

The log filter strings just do a wildcard match against the VIR_LOG_INIT("...."); lines in each source file, so you can make things more or less specific as you desire.

Regards,
Daniel

Signature · 9 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw
Quoted 67 lines · Daniel P. Berrange
Quoted 50 lines · Marek Marczykowski-Górecki
Quoted 49 lines · Jim Fehlig
Quoted 47 lines · Daniel P. Berrange
Quoted 23 lines · Jim Fehlig
Quoted 16 lines · Daniel P. Berrange
Quoted 7 lines · Jim Fehlig

Instead of a hardcoded DEBUG log level, use the overall daemon log level specified in libvirtd.conf when opening a log stream with libxl. libxl is very verbose when DEBUG log level is set, resulting in huge log files that can potentially fill a disk. Control of libxl verbosity should be placed in the administrator's hands.

Quoted 6 lines
---
 src/libxl/libxl_conf.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Quoted 5 lines

ACK, this makes sense as default behaviour. As a future enhancement you might also consider supporting a config setting in /etc/libvirt/libxl.conf to explicitly control the libxl library logging behaviour independantly.

Quoted 7 lines

I had actually thought of adding it there first, but then took this approach assuming it would be more receptive upstream :-). Personally, I'm on the fence. I like the idea of a single knob to control log level throughout the daemon, making it a bit easier on admins. On the other hand, individual knobs are more friendly to those pouring through logs. I can add a knob in libxl.conf if preferred.

After thinking about it some more, I could actually see value in create a dedicated virLogSource() instance, solely for libxl library messages. If we then created a virLogSourceGetPriority() method, you could query that to see if to turn on logging for the libxl library. That would ultimately allow you to turn on debug for just the libxl library if desired, eg

static virLogSource virLogLibXL = {
.name = "libxl.libxl_library",
....
}

LIBVIRT_LOG_FILTERS="1:libxl_library"

Quoted 8 lines
Quoted 1 line

Ah, good idea. I'll look into it.

Is it done anywhere? If not, how can I help?

This the above change (setting libxl log level to libvirtd global one), makes almost impossible to get libxl debug, because the rest of libvirtd trashes the logs (hundreds virEvent* and virObject* messages, at "info"(!) level).

Presumably that's because you are using LIBVIRT_DEBUG=1 or setting log_debug=1 in /etc/libvirt/libvirtd.log. That is generally discouraged because it turns on all logging, which is essentially unusably verbose.

It is also better to use more specific log settings, eg when I debug the QEMU driver I usually use

Quoted 7 lines

log_filters="1:qemu 1:security 3:event 3:object 1:util" log_outputs="1:file:/var/log/libvirt/libvirtd.log"

This generates log messages from every source file in qemu and security directories, and also log messages from every file in the util/ directory *except* for event & object files. So it is much more managable to read.

Ok, I'll try with "3:event 3:object", thanks!

Quoted 6 lines

The log filter strings just do a wildcard match against the VIR_LOG_INIT("...."); lines in each source file, so you can make things more or less specific as you desire.

Regards,
Daniel

Signature · 5 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel