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

Re: [Xen-devel] per-domain logging



On Tue, Oct 04, 2016 at 11:14:52AM +0200, Cedric Bosdonnat wrote:
> Hi Ian and Wei,
> 
> On Mon, 2016-09-19 at 16:23 +0100, Ian Jackson wrote:
> > Cedric Bosdonnat writes ("Re: [Xen-devel] per-domain logging"):
> > > On Thu, 2016-09-15 at 16:11 +0100, Wei Liu wrote:
> > > > IIRC there is already logfile abstraction inside libvirt -- can you just
> > > > pass in a libvirt logfile fd and try to demux there?
> > > 
> > > 
> > > The abstraction we have is something similar to the XenToolLogger,
> > > not something abstracting the log files. Even if we had that, how
> > > could we demux since there is no domain name in the libxl messages.
> 
> I came up with a commit on the libvirt side writing a custom xtl_logger
> that demuxes the log messages. Here it is for the curious ones:
> 
> https://github.com/cbosdo/libvirt/commit/5e28dd67c52a49b11635167469a8b60dcb4e287c
> 
> This way, libvirt would put all log messages containing ': Domain %u:' in a
> separate log file and all non-matching messages would go to the default
> libxl-driver.log file.
> 
> > Right.
> > 
> > It's not trivial to change the xtl API because there is no
> > negotiation, just a vops structure.  I can think of a way to do it,
> > but do we want to make all xtl logger users (that is, all generators
> > of log messages) pass a domid ?
> > 
> > Do we want to extend this to other information ?  (Not sure _what_
> > other information.)
> > 
> > Alternatively, we could have libxl (and perhaps libxc) put the domid
> > in a standard format in the message, so it could be extracted ?
> > 
> > However we do it, we would have to add a domid to every LOG call in
> > libxl.
> 
> Attached is a partial attempt at this that I wrote to test my libvirt code.
> How does that sound to you? Should I continue like this? Obviously I surely
> missed a few log messages that could get a domid, but it seems that even libxl
> has log messages that can't have a domid.
> 

Instead of trying to change all the format strings I think it would be
better to have a new set of LOG macros that takes domid.

Something like:
  LOGEVD(ERROR, errno, domid, "xxxx");

I would also like to have the log format written down in some document
or header file.

But let's step back a bit: have we agreed on the approach forward? This
thread doesn't seem to have a clear conclusion yet.  Obviously I don't
want you to waste your writing code that's going to be threw away.

If you're happy with demuxing in libvirt, I won't object to it. Looks
like there is relatively less code churn involved than other solutions,
say, libxl keeping track of a set of per-domain xtl loggers.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.