[Libvir] [PATCH] output virsh log to file

Richard W.M. Jones rjones at redhat.com
Thu May 24 08:22:49 UTC 2007

Nobuhiro Itou wrote:
> Certainly, virsh does not provide enough information now.
> But I want virsh to provide useful information in the future.
> First, I want to implement this logging function.
> In addition, I think that we should not let customers take trouble. 
> Cannot you apply this patch? 

The trouble is - the maintainers of libvirt have to maintain and live
with this patch forever, so they need to make sure it's right before it
goes in.

I wonder if a simpler solution can't be found which doesn't impact
libvirt/virsh codebase at all, but still allows persistent logging.  If
you wrap virsh in a shell script which runs logger, something like this:

#!/bin/bash -


$real_virsh "$@" 2> >(logger -t virsh)

(Well, that's not quite right because it _only_ sends stderr to syslog, 
but it's easy to fix that using something like 'tee').

This doesn't have any maintenance impact on libvirt code.  It sends logs 
to where users will expect to find them.  Log rotation is handled. 
Remote logging is handled.  And it's probably a lot more secure.


Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070524/a01574c5/attachment-0001.bin>

More information about the libvir-list mailing list