Обсуждение: BUG #18243: Ability to log in json format to stdout

Поиск
Список
Период
Сортировка

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

От
PG Bug reporting form
Дата:
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.