BUG #18243: Ability to log in json format to stdout

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: alisalemmi(at)outlook(dot)com
Subject: BUG #18243: Ability to log in json format to stdout
Date: 2023-12-12 18:57:17
Message-ID: 18243-b4b6647beca4c46b@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18243
Logged by: ali salemi
Email address: alisalemmi(at)outlook(dot)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.

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-12-12 19:28:29 BUG #18244: Corruption in indexes involving whole-row expressions
Previous Message Alvaro Herrera 2023-12-12 17:11:44 Re: BUG #18241: PushTransaction may cause Standby to execute ItemIdMarkDead