PostgreSQL 15 has now the capability to output logs in JSON format! PostgreSQL 15: logging in JSON The freshly released PostgreSQL 15 introduces a lot of new features and improvements, but one, according to me, is going to change the way our favourite database is monitored: the capability to log daemon status in JSON.
Essentially, the log_destination configuration parameter now has another enumerated value: jsonlog. When this value is added to log_destination, PostgreSQL will start to emit JSON structured logs.
Here it is a simple configuration example:
% grep log_destination /postgres/15/data/postgresql.conf
log_destination = ‘stderr,jsonlog’
and this is how the log directory appears right after the configuration has been reloaded:
% sudo -u postgres ls /postgres/15/data/log -1
External feed Read More at the Source: https://postgr.es/p/5r9