nut: manage logging#30043
Merged
Merged
Conversation
NUT (upstream) logging has changed. With the introduction of NUT_DEBUG_SYSLOG we can set it to "stderr" and have NUT's messages go to stderr only. This avoid most duplicate messages when procd sends stderr to syslog. The reverse (syslog only from NUT) is not a current configuration option. See the section for NUT_DEBUG_SYSLOG at https://networkupstools.org/docs/man/nut.conf.html#_directives This is needed because we use '-FF' so that the daemons remain in the foreground, which is required for procd to manage them. When using '-FF' logging behaves differently in NUT than when backgrounded. Unfortunately, there is still some work to be done upstream to completely eliminate duplicate messages, so some message continue to appear twice, though not neccessarily with the same facility.priority. See also https://github.com/jimklimov/nut/blob/0c3eed09b89cce1e5c0c65ca03d05b4612371cb8/UPGRADING.adoc#changes-from-282-to-283 and openwrt#29896 (comment) Conversely, the log messages the initscripts emit are now configured to emit only to syslog and not to stderr. This avoids duplicates messages caused by procd's automatic (not configurable) behaviour of sending the initscript's stderr to syslog, while preserving the syslogid, facility and priority we want. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
openwrt-ai
reviewed
Jul 19, 2026
openwrt-ai
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed 3 new commits (logging refactor). Commit messages match their diffs, the log-wrapper argument order is consistent with in-tree conventions, no stray logger -s remains, and CI has not reported failures. One minor consistency nit inline.
Generated by Claude Code
Show the PID beside the syslog_id to aid debugging. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
Where possible prefer the log wrappers to direct logger calls. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
danielfdickinson
force-pushed
the
pr-nut-manage-logging
branch
from
July 19, 2026 06:19
e7c6d6f to
1569e4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📦 Package Details
Maintainer: @danielfdickinson
Also notify: @drujd @BKPepe
Description:
NUT (upstream) logging has changed. With the introduction of
NUT_DEBUG_SYSLOG we can set it to "stderr" and have NUT's messages
go to stderr only.
This avoid most duplicate messages when procd sends stderr to syslog.
The reverse (syslog only from NUT) is not a current configuration
option. See the section for NUT_DEBUG_SYSLOG at
https://networkupstools.org/docs/man/nut.conf.html#_directives
This is needed because we use '-FF' so that the daemons remain in the
foreground, which is required for procd to manage them. When using
'-FF' logging behaves differently in NUT than when backgrounded.
Unfortunately, there is still some work to be done upstream to
completely eliminate duplicate messages, so some message continue to
appear twice, though not neccessarily with the same facility.priority.
See also
https://github.com/jimklimov/nut/blob/0c3eed09b89cce1e5c0c65ca03d05b4612371cb8/UPGRADING.adoc#changes-from-282-to-283
and
#29896 (comment)
Conversely, the log messages the initscripts emit are now configured to
emit only to syslog and not to stderr. This avoids duplicates messages
caused by procd's automatic (not configurable) behaviour of sending
the initscript's stderr to syslog, while preserving the syslogid,
facility and priority we want.
Also: Show the PID beside the syslog_id to aid debugging.
And: Where possible prefer the log wrappers to direct logger calls.
🧪 Run Testing Details
✅ Formalities