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
Set loglevels from config #4091
Conversation
No news file has been detected. Please write one, if applicable. |
This pull request introduces 1 alert when merging 20c4f4daafa815b8a178b47e1dd85fa983388641 into d8d8d0f - view on LGTM.com new alerts:
|
20c4f4d
to
7410142
Compare
Shouldn't we work the other way around? Command line options are usually stronger than configuration file options as they are easier to modify. For example, starting syslog-ng with -d is much quicker than removing/changing the option in the config. AFAIK other tools work similarly, for example, nginx has a command line flag to override a few directives inside the config file. |
Good point.
…On Fri, Jul 29, 2022, 18:29 László Várady ***@***.***> wrote:
Shouldn't we work the other way around? Command line options are usually
stronger than configuration file options as they are easier to modify. For
example, starting syslog-ng with -d is much quicker than removing/changing
the option in the config.
AFAIK other tools work similarly, for example, nginx has an option to
override a few directives inside the config file.
—
Reply to this email directly, view it on GitHub
<#4091 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFOK5RUSHEABRG6WZXKY73VWQBH3ANCNFSM55ALLVVQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
7410142
to
a307bdb
Compare
Build FAILURE |
a307bdb
to
4cb5d58
Compare
Build FAILURE |
1 similar comment
Build FAILURE |
fd2ff11
to
a60eed7
Compare
Build FAILURE |
a60eed7
to
e2fbe9e
Compare
@kira-syslogng seems to build on the response from "syslog-ng-ctl debug" which was changed by this PR. Can anyone help me with fixing that dependency? |
Build FAILURE |
@bazsi Of course. I'll take a look at this next week. |
e2fbe9e
to
2b641e5
Compare
Build FAILURE |
@kira-syslogng test this please test branch=followup_log_level_changes; test=functions/tools/syslog-ng-ctl/; |
Build FAILURE |
@kira-syslogng test this please test branch=followup_log_level_changes; test=functions/tools/syslog-ng-ctl/; |
Build FAILURE |
@kira-syslogng test this please test branch=followup_log_level_changes; |
Build FAILURE |
I'm just thinking out loud: This means that the In that case, we could say that the old syslog-ng-ctl commands are just for backward compatibility (deprecated), |
@bazsi What do you think? |
2b641e5
to
5ec9099
Compare
Build FAILURE |
done. |
@kira-syslogng test this please test branch=followup_log_level_changes; |
Build FAILURE |
Just for the record about the latest failing Kira job. |
@kira-syslogng test this please test branch=followup_log_level_changes; |
Build FAILURE |
@kira-syslogng test this please test branch=followup_log_level_changes; |
Latest Kira-starter job runs correctly (I have fixed the Kira job):
|
Thanks @mitzkia With that I think we can merge this once it gets a thumbs up from someone. |
891aa9a
to
380bc79
Compare
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
This patch adds a feature to control the internal verbosity of syslog-ng (e.g. verbose, debug, trace) via the configuration file. Example: options { log-level(debug); }; Possible values for log-level: - default, just normal log messages - verbose, normal + messages that get enabled via -v - debug, verbose + messages that get enabled via -d - trace, debug + messages that get enabled via -t The command line continues to dominate the log-level, e.g. if the command line contains options to control the level of logging, the configuration file would be ignored. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…-ctl to log levels syslog-ng-ctl is issuing separate commands for various log levels, e.g. LOG VERBOSE ON LOG DEBUG ON LOG TRACE ON which was operating on various verbosity flags exported by the messages module. This patch changes the implementation so while the interface continues to work, we are mapping the control commands to log levels. Whevever we turn ON verbose/debug/trace, we set the log level to that specific values. When we turn them OFF we set the log level one less than the specific value. LOG VERBOSE ON => verbose LOG VERBOSE OFF => default LOG DEBUG ON => debug LOG DEBUG OFF => verbose LOG TRACE ON => trace LOG TRACE OFF => debug This keeps compatibility with old syslog-ng-ctl binaries with a tiny change in functionality: the user will not be able to enable trace messages while not enabling debug at the same time. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…ate function Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…tl commands Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
This patch adds "log-level" to syslog-ng-ctl while using the old control commands. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
380bc79
to
57c8544
Compare
added some more unit tests to cover the cmdline/config overrides. |
@kira-syslogng test this please test branch=followup_log_level_changes; |
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.
Thank you. LGTM.
We'll merge this PR on Monday together with the internal testdb modification.
{ | ||
gboolean on = g_str_equal(onoff, "ON"); | ||
if (!on) | ||
ll = ll - 1; |
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.
One last note:
Asking our users to enable debug logging in production for a short period of time is quite usual, the support team does this frequently in the case of syslog-ng PE.
"Debug on" and then "debug off" now are not inverse functions.
I think this can be documented, and we can inform the affected parties about the change and the new intuitive log-level alternative.
This patch adds a feature to control the internal verbosity of syslog-ng (e.g. verbose, debug, trace) via the configuration file.
Example:
Possible values for log-level:
- default, just normal log messages
- verbose, normal + messages that get enabled via -v
- debug, verbose + messages that get enabled via -d
- trace, debug + messages that get enabled via -t
If the option is unset, we leave the settings as specified on the command line.
If we have log-level(default) it would override settings specified via the command line.
Rationale: in containerized environments, it is much easier to override log verbosity settings via the config file than via changing the command line options.