PostgreSQL logging JSON format with OpenSearch integration
As DBA I want to have better logging using the PostgreSQL v15 logging feature to save the logs in JSON format so that I can integrate these logs in OpenSearch and provide better readability of these logs.
This will provide 2 things:
1 - Parse of the fields of the log entries -> give more capabilities searching the logs - easily filter some field like user/database/application name
2 - Multi line queries in one log entry -> right now, multi line queries saves each line in a different log entry, which is very hard to filter a full query since the other lines doesn't have the log prefix. Using JSON format, it will save the full query in a single JSON entry (example: https://www.depesz.com/2022/01/17/waiting-for-postgresql-15-introduce-log_destinationjsonlog/)