sclorg / postgresql-container

PostgreSQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
164 stars 216 forks source link

Log to stdout/stderr #353

Closed fridex closed 1 year ago

fridex commented 4 years ago

We run postgres deployment from OpenShift service catalog on RH PSI. The postgres container logs to files which makes it harder/not straightforward to check what's going on in the OpenShift (its expected all services report logs to stdout/stderr). Would it be possible to adjust the configuration option of PG so that it logs to stdout/stderr?

hhorak commented 4 years ago

Few thoughts:

I've checked that mysql container logs to stderr by default.

There is already a generic way how to change any config parameter (and an example shows exactly changing the log destination: https://github.com/sclorg/postgresql-container/blob/master/examples/extending-image/postgresql-cfg/s2i-extending.conf).

While we cannot probably change the default behaviour of PostgreSQL, it makes sense to me to allow to do that easily, probably more easier than bind-mounting a config file or building a new layer as shown in extending-image/postgresql-cfg.

So, this PR is an attempt to make it more straightforward, but setting -e POSTGRESQL_LOG_DESTINATION=/dev/stderr.

@UncleAlbie @pkubatrh @phracek What do you think?

fila43 commented 1 year ago

The mentioned feature(POSTGRESQL_LOG_DESTINATION=/dev/stderr) was already added by https://github.com/sclorg/postgresql-container/pull/366.