postgres/src/backend
Michael Paquier dc686681e0 Introduce log_destination=jsonlog
"jsonlog" is a new value that can be added to log_destination to provide
logs in the JSON format, with its output written to a file, making it
the third type of destination of this kind, after "stderr" and
"csvlog".  The format is convenient to feed logs to other applications.
There is also a plugin external to core that provided this feature using
the hook in elog.c, but this had to overwrite the output of "stderr" to
work, so being able to do both at the same time was not possible.  The
files generated by this log format are suffixed with ".json", and use
the same rotation policies as the other two formats depending on the
backend configuration.

This takes advantage of the refactoring work done previously in ac7c807,
bed6ed3, 8b76f89 and 2d77d83 for the backend parts, and 72b76f7 for the
TAP tests, making the addition of any new file-based format rather
straight-forward.

The documentation is updated to list all the keys and the values that
can exist in this new format.  pg_current_logfile() also required a
refresh for the new option.

Author: Sehrope Sarkuni, Michael Paquier
Reviewed-by: Nathan Bossart, Justin Pryzby
Discussion: https://postgr.es/m/CAH7T-aqswBM6JWe4pDehi1uOiufqe06DJWaU5=X7dDLyqUExHg@mail.gmail.com
2022-01-17 10:16:53 +09:00
..
access Unify VACUUM VERBOSE and autovacuum logging. 2022-01-14 16:50:34 -08:00
bootstrap Update copyright for 2022 2022-01-07 19:04:57 -05:00
catalog Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
commands Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
executor Fix memory leak in indexUnchanged hint mechanism. 2022-01-12 15:41:04 -08:00
foreign Update copyright for 2022 2022-01-07 19:04:57 -05:00
jit Update copyright for 2022 2022-01-07 19:04:57 -05:00
lib Update copyright for 2022 2022-01-07 19:04:57 -05:00
libpq Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
main Update copyright for 2022 2022-01-07 19:04:57 -05:00
nodes Rename value node fields 2022-01-14 11:26:08 +01:00
optimizer Teach hash_ok_operator() that record_eq is only sometimes hashable. 2022-01-16 16:39:26 -05:00
parser Rename value node fields 2022-01-14 11:26:08 +01:00
partitioning Update copyright for 2022 2022-01-07 19:04:57 -05:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Update copyright for 2022 2022-01-07 19:04:57 -05:00
postmaster Introduce log_destination=jsonlog 2022-01-17 10:16:53 +09:00
regex Update copyright for 2022 2022-01-07 19:04:57 -05:00
replication Improve error handling of cryptohash computations 2022-01-11 09:55:16 +09:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
storage Improve warning message in pg_signal_backend() 2022-01-11 12:56:26 -05:00
tcop Update copyright for 2022 2022-01-07 19:04:57 -05:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Introduce log_destination=jsonlog 2022-01-17 10:16:53 +09:00
.gitignore
common.mk
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00