Re: [PATCH] output virsh log to file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 06, 2007 at 05:39:40PM +0900, Nobuhiro Itou wrote:
> >   I expect the use to be the following:
> >      - users uses virsh for virtualization operation
> >      - something suddenly does not work
> >      - then he re-runs the command with logging 
> >      - then he can analyze the log or transmit it to a sysadmin who
> >        can have a look
> > but I don't believe in reimplementing something like syslog within virsh to 
> > log all operations all the time, especially with a fixed size buffer. logs 
> > will be intermixed, hard to process, add a burden on the server, and makes
> > the code way more complex than it needs to be.
> > 
> >   Maybe I didn't understood how you expected logging to work, but apparently
> > we had different viewpoints, I would rather go for the simplest,
> 
> I agree.

  excellent !

> >   does that still work for your use case ?
> 
> Yes.
> How about this attached patch?

  Way simpler, that works, I just fixed a couple of things:
    - removed defines for buffer size which were not needed anymore
    - if no log file name was given do not try to open it

I commited this in CVS but I'm afraid there is something missing, look at the
following:

paphio:~/libvirt/src -> ./virsh --log logfile list
libvir: error : no support for hypervisor (null)
virsh: error: failed to connect to the hypervisor
paphio:~/libvirt/src -> cat logfile
[2007.06.06 14:26:30 virsh] ERROR failed to connect to the hypervisor
paphio:~/libvirt/src -> 

the machine is not running Xen so the error is normal, the trouble is that
the logfile only contains the virsh error not the libvirt one (which is the
one the most useful), this need debugging I guess.
Another question is that the log file is opened in append mode, while I guess
this kind of option usually rewrite the file from scratch, but this is an 
open question, I can see how both behaviour could be useful or annoying 
depending on the circumstances.

  thanks !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard@xxxxxxxxxx  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]