-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/pgbouncer] log to stdout only by default #68905
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have this feature! LGTM! 👍
Hi @taraspos, Thank you very much for your contribution! Although, I would like to request some changes. Because the best practice for containers would be to only log to stdout, to prevent filling the container filesystem with unnecessary files, I would like to make it the default behavior. To do so, I would like to request the following changes:
- export PGBOUNCER_LOG_FILE="${PGBOUNCER_LOG_FILE:-${PGBOUNCER_LOG_DIR}/pgbouncer.log}"
+ export PGBOUNCER_LOG_FILE="${PGBOUNCER_LOG_FILE:-}"
- | `PGBOUNCER_LOG_FILE` | PgBouncer log file. | `${PGBOUNCER_LOG_DIR}/pgbouncer.log` |
+ | `PGBOUNCER_LOG_FILE` | If set, log PgBouncer output to log file in addition to stdout. | `nil` | |
Signed-off-by: Taras Postument <[email protected]>
@migruiz4 all done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
@migruiz4 thank you! |
May I ask what the ETA for the release is? :) |
I triggered a new release now, so in about 30 more minutes or so a new PR should be submitted, tested, and merged automatically if everything goes well. |
Thanks! 💪 |
Description of the change
Add option to disable logging to file by settingPGBOUNCER_LOG_FILE=disable
.Change default to log to stdout only (instead of stdout and file) by default.
Benefits
pgbouncer is running in the foreground (without the
-d
flag) mode so logs are written to stdout anyway.When running on Kubernetes/ECS/etc this is enough and having same information in a logfile is unnecessary. From my experience this logfile can grow quite large and having option to disable can fix potential disk space problems.
logfile
definition from pgbouncer config documentation:Possible drawbacks
N/A
Applicable issues
Additional information
pgbouncer.ini with default PGBOUNCER_LOG_FILE value
pgbouncer.ini with PGBOUNCER_LOG_FILE=/tmp/test