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-level-overrides does not permit spaces in value string #1063
Comments
This issue is even worse in the default configuration, where the long line of statistics is printed to the log every minute. While the server stats log messages cannot be filtered, an other option is to set the
The default value of it is 1 minute, but if you increase it to an hour or a day, it might be less of a problem. If you make use of this, don't forget that this also affects the execution of cleanup operations. |
I would like to leave the logging level of the server on INFO. However having an entry for server stats every hour is a little too much noise. So for "server stats" I want to set the level to WARN. The log-level-overrides entry should be this, but doing so causes the server load to fail:
"message=Server stats -> warn"
In digging through the code I found the following regex in ntfy/cmd/app.go, line 31:
(?i)^([^=\s]+)(?:\s*=\s*(\S+))?\s*->\s*(TRACE|DEBUG|INFO|WARN|ERROR)$
The culprit is "\S+". Changing the regex to this works, if this is a bug:
(?i)^([^=\s]+)(?:\s*=\s*(.+))?\s*->\s*(TRACE|DEBUG|INFO|WARN|ERROR)$
You as the authors of the code may have done this on purpose because multiple words (and the whitespace that comes with them) could break search logic deeper in the code. Is this a bug or a choice?
The text was updated successfully, but these errors were encountered: