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

From: Jim Nasby <jim(at)nasby(dot)net>
To: 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 04:04:48
Message-ID: 53FD58E0.5030801@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/26/14, 8:45 PM, Michael Paquier wrote:
> Hi all,
>
> As mentioned here, we support multiple logging format:
> http://www.postgresql.org/docs/devel/static/runtime-config-logging.html
> Now what about a json format logging with one json object per log entry?
>
> A single json entry would need more space than a csv one as we need to
> track the field names with their values. Also, there is always the
> argument that if an application needs json-format logs, it could use
> csvlog on Postgres-side and do the transformation itself. But wouldn't
> it be a win for application or tools if such an option is available
> in-core?
>
> Note that I am not planning to work on that in a close future, but it
> would be a good TODO item for beginners if it is worth pursuing.

Perhaps instead of doing this in-core it would be better to make log handling more extensible? I'm thinking add a specific "binary" format and an external tool that can parse that and do whatever the user wants with it. That means we don't have to keep adding more complexity to the internal log handling (which already has the risk of being a bottleneck), while allowing maximum user flexibility.
--
Jim C. Nasby, Data Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-08-27 04:04:53 Re: Similar to csvlog but not really, json logs?
Previous Message Amit Kapila 2014-08-27 04:04:05 Re: postgresql latency & bgwriter not doing its job