Skip to content

feat(ns-plug): add loglevel configuration to alert-proxy#1745

Open
gsanchietti wants to merge 1 commit into
mainfrom
metrics_fixes
Open

feat(ns-plug): add loglevel configuration to alert-proxy#1745
gsanchietti wants to merge 1 commit into
mainfrom
metrics_fixes

Conversation

@gsanchietti

Copy link
Copy Markdown
Member

Summary

  • Add option loglevel 'warning' to ns-plug UCI config (default: silent on normal operation)
  • Replace all print() calls in ns-plug-alert-proxy with Python logging module
  • At warning level (default): only send failures and aborts appear in syslog
  • At debug level: full output restored — sent alerts, dropped alerts (no mapping / not registered), startup message

Log level mapping

Message Level
Alert sent: ... DEBUG
Alert dropped (no mapping): ... DEBUG
Alert dropped (not registered): ... DEBUG
alert-proxy listening on ... INFO
Alert send failed: ... retrying WARNING
Alert send aborted: ... WARNING

How to enable debug logging

uci set ns-plug.config.loglevel=debug
uci commit ns-plug
service ns-plug-alert-proxy restart
logread -f | grep alert-proxy

Test plan

  • With default config (loglevel=warning): send a mapped alert → no output in logread; send failed alert → warning appears
  • With loglevel=debug: all messages (sent, dropped, startup) appear in logread
  • Unregistered machine (loglevel=debug): Alert dropped (not registered) appears in logread

🤖 Generated with Claude Code

Default loglevel is 'warning' so only send failures appear in syslog.
Set loglevel=debug to restore verbose output (sent/dropped alerts).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant