-
Notifications
You must be signed in to change notification settings - Fork 100
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
Log to stderr by turning off the log file collector #968
Conversation
Fixes ManageIQ/container-postgresql#40 Drop the no longer used options for logging to a file. Related: CrunchyData/postgres-operator#1141 (comment)
Checked commit jrafanie@9eaf5da with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
@@ -38,8 +38,10 @@ hot_standby = on | |||
# ERROR REPORTING AND LOGGING | |||
#------------------------------------------------------------------------------ | |||
|
|||
log_filename = 'postgresql.log' | |||
log_rotation_age = 0 | |||
log_destination = 'stderr' |
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.
Technically, this is the default... but I added stderr
to ensure this is explicit.
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.
Any reason not to use stdout?
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.
That's not an option in the settings: https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE
Ultimately it's probably preferable to use jsonlog, but then I'm not sure you can do jsonlog and do to stderr.
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.
It's not an option (stderr, csvlog, jsonlog, and syslog) according to https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE. Perhaps it's to simplify things as log_collector
"on" would need to redirect both stdout and stderr to logs.
log_collector
This parameter enables the logging collector, which is a background process that captures log messages sent to stderr and redirects them into log files
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.
@Fryguy you beat me to it
log_rotation_age = 0 | ||
log_destination = 'stderr' | ||
# This is used when logging to stderr: | ||
logging_collector = off |
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.
This is what actually turns off logging to files and logs to stderr.
log_connections = on | ||
log_disconnections = on |
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.
Should we drop these? It seemed very chatty in the demo env.
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.
Possibly? But, not here... I opened #969 to track the autovacuum settings but we can certainly review them all to see if we need those logged.
Backported to
|
Log to stderr by turning off the log file collector (cherry picked from commit be93f41)
Fixes ManageIQ/container-postgresql#40
Drop the no longer used options for logging to a file.
Related: CrunchyData/postgres-operator#1141 (comment)
Technically, it's an enhancement, but you can't look at pg logs in podified without visiting the pg pod so users would probably say this is a bug.
EDIT: We saw some possibly no longer used/wrong settings so I opened an issue to start that discussion: #969