-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,10 @@ hot_standby = on | |
# ERROR REPORTING AND LOGGING | ||
#------------------------------------------------------------------------------ | ||
|
||
log_filename = 'postgresql.log' | ||
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 commentThe 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_min_duration_statement = 5000 | ||
log_connections = on | ||
log_disconnections = on | ||
Comment on lines
46
to
47
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
|
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.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