Skip to content

feat(config): add rsyslog_level field to NetworkConfig for syslog severity filtering#870

Open
PhilipLykov wants to merge 1 commit intomeshtastic:masterfrom
PhilipLykov:feature/syslog-level-filter
Open

feat(config): add rsyslog_level field to NetworkConfig for syslog severity filtering#870
PhilipLykov wants to merge 1 commit intomeshtastic:masterfrom
PhilipLykov:feature/syslog-level-filter

Conversation

@PhilipLykov
Copy link

Summary

  • Add LogLevel enum to NetworkConfig with values matching LogRecord.Level (UNSET=0, TRACE=5, DEBUG=10, INFO=20, WARNING=30, ERROR=40, CRITICAL=50)
  • Add rsyslog_level field (tag 12) to NetworkConfig to allow users to configure the minimum syslog severity level
  • Default (UNSET) is treated as INFO by the firmware, filtering out DEBUG messages

Motivation

Currently the Meshtastic firmware forwards all log messages to the configured rsyslog server with no way to filter by severity. This generates significant syslog traffic, especially from DEBUG messages that are rarely needed in production.

This protobuf change adds the configuration field needed to support severity-based filtering. The companion firmware PR (meshtastic/firmware) implements the filtering logic using the existing Syslog::logMask() mechanism.

Backwards Compatibility

  • The new field defaults to 0 (LOG_UNSET), which the firmware treats as INFO level
  • Existing devices that upgrade will automatically filter out DEBUG syslog messages (reducing noise)
  • No breaking changes to existing fields or wire format

Test plan

  • Verify protobuf generation succeeds with the new enum and field
  • Verify firmware builds with the generated nanopb files
  • Test on RAK4631 Ethernet Gateway: confirm DEBUG messages are filtered by default
  • Test setting rsyslog_level to DEBUG: confirm all messages forwarded
  • Test setting rsyslog_level to WARNING: confirm only WARNING, ERROR, CRITICAL forwarded

…erity filtering

Add a LogLevel enum and rsyslog_level field to NetworkConfig to allow
users to control which log messages are forwarded to the rsyslog server.
Only messages at or above the configured severity level are sent.

The LogLevel values (UNSET=0, TRACE=5, DEBUG=10, INFO=20, WARNING=30,
ERROR=40, CRITICAL=50) match LogRecord.Level for consistency.

Default behavior (UNSET) sends INFO and above, filtering out DEBUG
messages to reduce syslog noise.

Made-with: Cursor
PhilipLykov added a commit to PhilipLykov/Meshtastic_firmware that referenced this pull request Feb 27, 2026
Add rsyslog_level field to NetworkConfig protobuf and wire it to the
existing Syslog::logMask() filtering mechanism. Users can now control
which log messages are forwarded to the rsyslog server by severity.

Changes:
- Add LogLevel enum and rsyslog_level field (tag 12) to NetworkConfig
  in config.proto and generated nanopb files
- Add syslogLevelToMask() helper in DebugConfiguration.h to map config
  values to syslog LOG_UPTO() bitmasks
- Apply the configured log mask during syslog initialization in both
  ethClient.cpp (Ethernet) and WiFiAPClient.cpp (WiFi)

Default behavior: UNSET (0) is treated as INFO, filtering out DEBUG
messages. This reduces syslog noise for production deployments.

Companion protobuf PR: meshtastic/protobufs#870

Made-with: Cursor
PhilipLykov added a commit to PhilipLykov/Meshtastic_firmware that referenced this pull request Feb 27, 2026
Add rsyslog_level field to NetworkConfig protobuf and wire it to the
existing Syslog::logMask() filtering mechanism. Users can now control
which log messages are forwarded to the rsyslog server by severity.

Changes:
- Add LogLevel enum and rsyslog_level field (tag 12) to NetworkConfig
  in config.proto and generated nanopb files
- Add syslogLevelToMask() helper in DebugConfiguration.h to map config
  values to syslog LOG_UPTO() bitmasks
- Apply the configured log mask during syslog initialization in both
  ethClient.cpp (Ethernet) and WiFiAPClient.cpp (WiFi)

Default behavior: UNSET (0) is treated as INFO, filtering out DEBUG
messages. This reduces syslog noise for production deployments.

Companion protobuf PR: meshtastic/protobufs#870

Made-with: Cursor
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