logfmt and application_context

From: Étienne BERSAC <etienne(dot)bersac(at)dalibo(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: logfmt and application_context
Date: 2023-08-30 12:36:39
Message-ID: 7e5a39c66e85d3794f04936bf723df8ae2a0992d.camel@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi everyone,

I just release a logfmt log collector for PostgreSQL :
https://pgxn.org/dist/logfmt/1.0.0/ . This works quite well but I have
a few issues I would like to share with hackers.

First, what do you think of having logfmt output along json and CSV ?
PostgreSQL internal syslogger has builtin support for the different
LOG_DESTINATION_*. Thus logfmt does not send log collector headers
using write_syslogger_file or write_pipe_chunks but plain log line with
write_console. Do you have some hint about this ? The consequences ?
How much is it a good bet to write a custom log collector in a shared
preload library ?

Second issue, logfmt provides a guc called
`logfmt.application_context`. The purpose of application_context is the
same as `application_name` but for a more varying value like request
UUID, task ID, etc. What do you think of this ? Would it be cool to
have this GUC in PostgreSQL and available in log_line_prefix ?

Anyway, it's my first attempt at writing C code for PostgreSQL, with
the help of Guillaume LELARGE and Jehan-Guillaume de RORTHAIS and it's
a pleasure ! PostgreSQL C code is very readable. Thanks everyone for
this !

Regards,
Étienne BERSAC
Developer at Dalibo

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2023-08-30 12:38:52 Re: PATCH: Add REINDEX tag to event triggers
Previous Message Tomas Vondra 2023-08-30 12:16:47 Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)