-
Notifications
You must be signed in to change notification settings - Fork 116
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
Disable query logging default #128
base: master
Are you sure you want to change the base?
Conversation
By default, the bind formula will configure the named process to write all queries into a query.log file which potentially is outside the normal log-rotated dirs, thus filling up the disk. This is rather unexpected on high traffic DNS servers. Disable by default, can be explicity reenabled by setting enable_logging to True. Rework jinja logic to make enable_logging and use_extensive_logging mutually exclusive rather than having them "stacked". It makes no sense to have the fine-grained use_extensive_logging configuration depend on the coarse-grained enable_logging toggle. I am actually tempted to rename enable_logging to enable_query_log which is a much clearer description of the functionality. Comments? Somewhat related, log_dir is /var/log/something for every OS except Red Hat where it is defined as /var/named/data... Any reason not to fix that inconsistency other than the use of the chrooted functionality on Red Hat?
I like the approach you took, it LGTM 👍
Perhaps this can be done in another PR |
logging_config was only defined for Debian and xBSD resulting in rendering errors on other OS families. This commit fixes saltstack-formulas#115
Add a deprecation message if enable_logging is used instead of enable_query_log. Abort if both enable_logging/enable_query_log is enabled with use_extensive_logging as these are mutually exclusive now. Fixup tests to _not_ look for the querylog line.
@javierbertoli Did that. As there's no pillar.set (contrary to grains.set) I did a bit of a workaround. Have a look, should be passing checks now as well. |
@javierbertoli ping? |
@@ -147,7 +147,7 @@ | |||
# Match 100.51.198 reverse zone from pillar | |||
its('content') { should match /^zone\ "100\.51\.198\.in-addr\.arpa"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}\/100\.51\.198\.in-addr\.arpa";\n\ \ \n\ \ notify\ no;\n\};/ } | |||
# Match logging | |||
its('content') { should match /^logging\ \{\n\ \ channel\ "querylog"\ {\n\ \ \ \ file\ "#{log_directory}\/query\.log";\n\ \ \ \ print-time\ yes;\n\ \ \};\n\ \ category\ queries\ \{\ querylog;\ \};\n\};/ } | |||
its('content') { should_not match /^logging\ \{\n\ \ channel\ "querylog"\ {\n\ \ \ \ file\ "#{log_directory}\/query\.log";\n\ \ \ \ print-time\ yes;\n\ \ \};\n\ \ category\ queries\ \{\ querylog;\ \};\n\};/ } |
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.
As you're moving the logging config to another file, can you either add some tests to make sure the logging_config
file/s are created properly, or open an issue so we don't forget to add tests for this? Perhaps I can find some time to add them
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.
Okay. Let me rework this a bit...
Hi there! Any news? |
By default, the bind formula will configure the named process to
write all queries into a query.log file which potentially is outside
the normal log-rotated dirs, thus filling up the disk.
This is rather unexpected on high traffic DNS servers.
Disable by default, can be explicity reenabled by setting enable_logging
to True.
Rework jinja logic to make enable_logging and use_extensive_logging mutually
exclusive rather than having them "stacked". It makes no sense to have the
fine-grained use_extensive_logging configuration depend on the coarse-grained
enable_logging toggle.
I am actually tempted to rename enable_logging to enable_query_log which is a
much clearer description of the functionality. Comments?
Somewhat related, log_dir is /var/log/something for every OS except Red Hat
where it is defined as /var/named/data... Any reason not to fix that
inconsistency other than the use of the chrooted functionality on Red Hat?