mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #1063] log-level-overrides does not permit spaces in value string #744
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#744
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @patanne on GitHub (Mar 21, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1063
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?
@mpeter50 commented on GitHub (May 1, 2024):
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
manager-intervalconfig value.The docs say this about it:
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.
Actually, for me filtering the messages would have been the workaround, this (less frequent stats logging) is the solution I was looking for.
If you make use of this, don't forget that this also affects the execution of cleanup operations.