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

Liu Yuan namei.unix at gmail.com
Tue Jan 29 06:33:31 CET 2013


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

But we'd better ask for Kazum's ack to finally get it in.

Thanks,
Yuan



More information about the sheepdog mailing list