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
nixos/postgres Add syslog option #94231
Conversation
Having the option to use postgres to log all your queries should be quite valuable to many users. Doing this at application level is usually less reliable and slower.
Does logging work as desired if you add this new configuration to |
Thanks for answering. Two things:
|
Default behavior appears to be logging to some file in
Probably yeah. Especially log_statement all may not always be desirable for larger apps.
So you mean a configuration option per postgres option nested within something called logging? Yeah I can rework it into that. |
Actually I think that writing of files into |
I believe |
What about something like this? |
Maybe that didn't work because I still had the log collector enabled? Wait I'll try again |
Yeah it was that, so enabling the logging collector will capture the stderr, and then if you enable syslog you get both files and syslog output. The advantage being that logging collector will never drop a message (at a small risk of freezing the system if it's unable to write for some reason). |
@aanderse I just saw yeah, but I didn't want to break backward compatibility, and I also like having the types, there are several fields which are simply weird booleans or enums. But you're right, it's pretty much a one to one mapping. |
The problem with applying type checking to less commonly used configuration values (ie. making them options) is that you end up replicating the entire configuration file eventually. See NixOS/rfcs#42 for an interesting discussion on the pros and cons of options vs a single |
@aanderse Okay, I see, so module size appears to be a big problem (I thought it was the opposite, more = better). These logging options then shouldn't be added as separate options but as in your suggestion. You should make a PR for that. |
Motivation for this change
Having the option to use postgres to log all your queries should
be quite valuable to many users.
Doing this at application level is usually less reliable and slower.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)