Skip to content
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

Enable per-database control of postgres logging #5574

Open
2 tasks
acozine opened this issue Dec 2, 2024 · 0 comments
Open
2 tasks

Enable per-database control of postgres logging #5574

acozine opened this issue Dec 2, 2024 · 0 comments
Labels

Comments

@acozine
Copy link
Contributor

acozine commented Dec 2, 2024

User story

As a developer or operations engineer, I sometimes want to enable verbose logging for a single database within our postgresql environment. I'd like to be able to run a playbook to switch the logging level for individual databases, with a variable in this repo as a source of truth.

Follow-up to #5257 (comment).

Acceptance criteria

  • I can update a variable in group_vars, run a playbook, and change the log level for a single postgresql database.
  • it would be great if the playbook also returned the current setting for each database

Concrete example

During testing or troubleshooting, I might want all statements logged. During regular runtime, I want minimal logging.

Implementation notes, if any

The command to change per-database logging manually is:

ALTER DATABASE your_database_name
SET log_statement = 'all';

See this ServerFault question.
Other possibly helpful resources:
BetterStack blog post
PostgreSQL docs

@acozine acozine added the feature label Dec 2, 2024
@acozine acozine changed the title Enable per-database control of logging Enable per-database control of postgres logging Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant