BUG #18243: Ability to log in json format to stdout - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18243: Ability to log in json format to stdout
Date
Msg-id 18243-b4b6647beca4c46b@postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18243
Logged by:          ali salemi
Email address:      alisalemmi@outlook.com
PostgreSQL version: 16.1
Operating system:   Debian 12 (postgres:16.1 image)
Description:

I am currently setting up PostgreSQL within a Kubernetes environment and
have encountered a logging challenge. PostgreSQL offers two logging
options:
1. Logging to stderr.
2. Logging in JSON format to a file.

However, I require PostgreSQL to log in JSON format directly to stdout, as
this aligns with Kubernetes’ best practices for logging. Logging to a file
introduces additional complexities, such as log rotation and deletion, which
are typically handled by logrotate. Unfortunately, the container images I am
using do not include logrotate.

I am considering a solution that allows logging in either stdout or a file,
regardless of the format, to circumvent these issues. I am seeking guidance
or suggestions on how to implement this effectively within Kubernetes,
ensuring that log management adheres to best practices and does not
compromise the integrity and performance of the PostgreSQL service.


pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #18241: PushTransaction may cause Standby to execute ItemIdMarkDead
Next
From: PG Bug reporting form
Date:
Subject: BUG #18244: Corruption in indexes involving whole-row expressions