postgresql-container icon indicating copy to clipboard operation
postgresql-container copied to clipboard

Log to stdout/stderr

Open fridex opened this issue 6 years ago • 1 comments

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?

fridex avatar Nov 29 '19 09:11 fridex

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?

hhorak avatar Mar 23 '20 08:03 hhorak

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

fila43 avatar Mar 30 '23 14:03 fila43