[sheepdog] [PATCH RFC 0/3] logger: selectable log format

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Jan 29 07:29:35 CET 2013


At Tue, 29 Jan 2013 13:33:31 +0800,
Liu Yuan wrote:
> 
> On 01/28/2013 07:15 PM, Hitoshi Mitake wrote:
> > This patch set implements a mechanism for selectable log format in
> > logger. Current logger writes log in a fixed format. It is hard to
> > parse by machine. So the only wai to read logs is opening them with
> > text editors or pagers.
> > 
> > This patch set implements logging in json format as an example. So we
> > can write programs like pretty printers or state machines on
> > them. These might be helpful for debugging and analyzing sheepdog.
> > 
> > This is an example of a log formatted in json:
> > {"time": "1359367663", "worker_name": "main", "worker_idx": 0, "func":
> > "jrnl_recover", "line": 230, "body": "opening the directory
> > /store/sheep/journal/"}
> > 
> > A similar log line formatted in default style is like this:
> > Jan 28 20:07:52 [main] jrnl_recover(230) opening the directory
> > /store/sheep/journal/
> > 
> > (My personal intention is using this feature for debugging shepherd :)
> 
> The whole patch set looks fine to me, except that I'd suggest following
> name change:
>  default_log_format -> default_log_formatter
>  json_log_format -> json_log_formatter

I agree with this name changes. I'll do this in the v2.

Thanks,
Hitoshi



More information about the sheepdog mailing list