zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.33k stars 979 forks source link

How to stdout postgres logs? #1661

Open sanketg86 opened 3 years ago

sanketg86 commented 3 years ago

Please, answer some short questions which should help us to understand your problem / question better?

Could you please guide me how do I stdout postgres log from postgres container? When Pod get restart all logs vanished. I want to stdout and see in google console logging instead of store on file-system path in csv file.

FxKu commented 2 years ago

Can be done with a sidecar, I think. We once used scalyr for this.

skaffille commented 2 years ago

Hi, what about logging to stderr instead of stdout with help of this in the cluster CRD?

spec:
  postgresql:
    parameters:
      log_destination: stderr
      logging_collector: "off"

No sidecar needed ...

mkhodave commented 2 years ago

@skaffille : above postgresql configuration already configured in our manifest , still we are not able to see at postgresql.csv , moreover we need these logs at stdout for postgres container

stephan2012 commented 2 years ago

For me, a fluentd based sidecar container that exports the logs to JSON on stdout works well.