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