Re: Similar to csvlog but not really, json logs?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Similar to csvlog but not really, json logs?
Date: 2014-08-27 03:11:07
Message-ID: 17825.1409109067@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> I think the extra representational overhead is already a good reason to
>> say "no". There is not any production scenario I've ever heard of where
>> log output volume isn't a consideration.

> The flip side is that there are absolutely production cases where what
> we output is either too little or too much- being able to control that
> and then have the (filtered) result in JSON would be more-or-less
> exactly what a client of ours is looking for.

> To try to clarify that a bit, as it comes across as rather opaque even
> on my re-reading, consider a case where you can't have the
> "credit_card_number" field ever exported to an audit or log file, but
> you're required to log all other changes to a table. Then consider that
> such a situation extends to individual INSERT or UPDATE commands- you
> need the command logged, but you can't have the contents of that column
> in the log file.

Hmm ... that's a lovely use-case, but somehow I don't find "let's output
in JSON" to be a credible solution. Not only are you paying extra output
log volume to do that, but you are also supposing that some downstream
process is going to parse the JSON, remove some data (which JSON-izing
the log format didn't especially help with, be honest), and re-emit JSON
afterwards. There's no way that that scales to any production situation,
even if you had parallel log-filtering processes which you won't.

I am interested in thinking about your scenario; I just don't think
that JSON output format is any real part of the answer.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2014-08-27 03:16:07 Re: Switch pg_basebackup to use -X stream instead of -X fetch by default?
Previous Message Peter Eisentraut 2014-08-27 03:10:36 Re: pgcrypto: PGP signatures