Skip to content

feat(mw/log): add Linux syslog backend for LogMode::kSystem - #271

Draft
btirunagaru wants to merge 3 commits into
eclipse-score:mainfrom
qualcomm:feat/syslog_on_linux
Draft

feat(mw/log): add Linux syslog backend for LogMode::kSystem#271
btirunagaru wants to merge 3 commits into
eclipse-score:mainfrom
qualcomm:feat/syslog_on_linux

Conversation

@btirunagaru

@btirunagaru btirunagaru commented Aug 21, 2026

Copy link
Copy Markdown

Description

Adds a Linux syslog(3) backend for mw::log's LogMode::kSystem slot
(SyslogBackend + SyslogRecorderFactory + BackendRegistrant), following
the existing QNX slog backend's design. Includes unit tests against
score_baselibs//score/os/mocklib:syslog_mock covering log-level to
syslog-priority mapping and slot lifecycle.

Depends on the companion score::os::Syslog OS wrapper contributed to
baselibs (eclipse-score/baselibs#501,
@score_baselibs//score/os:syslog) — should merge/release together.

Related ticket

closes #270

Relates to eclipse-score/baselibs#501, implemented in eclipse-score/baselibs#502

Adds a Linux syslog mw::log backend that fills the LogMode::kSystem
slot on Linux (HGY aarch64 and x86 host), mirroring the existing QNX
slog backend exactly. slog is target_compatible_with os:qnx and this
new backend is target_compatible_with os:linux, so exactly one
compiles per build and both can safely reuse the same kSystem slot
without any LogMode/dispatch changes.

- score/mw/log/detail/syslog/syslog_backend.{h,cpp}: SyslogBackend,
  a Backend implementation whose FlushSlot formats
  "appid,ctxid: payload" and forwards to
  score::os::Syslog::syslog() at a severity mapped from mw::log's
  LogLevel (kFatal->LOG_CRIT, kError->LOG_ERR, kWarn->LOG_WARNING,
  kInfo->LOG_INFO, kDebug/kVerbose->LOG_DEBUG); Init() calls
  openlog(app_id, LOG_PID|LOG_NDELAY, LOG_USER).
- score/mw/log/detail/syslog/syslog_recorder_factory.{h,cpp}: CRTP
  SyslogRecorderFactory wiring a TextRecorder over SyslogBackend,
  using score::os::Syslog::Default() for the real OS wrapper.
- score/mw/log/detail/syslog/{syslog_backend_test,
  syslog_recorder_factory_test}.cpp: unit tests against
  @score_baselibs//score/os/mocklib:syslog_mock.
- score/mw/log/backend/syslog_registrant.cpp: registers
  CreateSyslogRecorder against LogMode::kSystem via
  BackendRegistrant, mirroring slog_registrant.cpp.
- score/mw/log/backend/BUILD: new syslog cc_library
  (target_compatible_with os:linux, alwayslink), plus the
  detail/syslog BUILD for syslog_backend/syslog_recorder_factory.

Depends on the companion score::os::Syslog OS wrapper contributed to
the baselibs component (@score_baselibs//score/os:syslog).

Signed-off-by: Bharath Tirunagaru <bharatht@qti.qualcomm.com>
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: b57068b9-dfd6-4a75-b354-5d2bfd073076
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
Loading: 4 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 12.104s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@rmaddikery rmaddikery left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I would first request the following:
Component requirements updated/added to clarify the expectation and understand how it could be achieved. Hence additionally supporting static/dynamic diagrams. Once this is finalized we can look into the source files. Please note that we are still in the migration phase of the repository from an internal one. Until we have established the quality gating and traceability of the requirements, no changes are merged here directly. In that regard we ask you for your patience. If you have questions please reach out to us in the Logging CFT: https://github.com/orgs/eclipse-score/discussions/3192

- Set copyright year to 2026 on all newly added files, matching the
  companion fix in the baselibs syslog wrapper PR.

Signed-off-by: Bharath Tirunagaru <bharatht@qti.qualcomm.com>
Addresses review feedback requesting requirements and static/dynamic
diagrams for the new SyslogBackend before source-level review:

- Extend comp_req__log__forward_to_system_logger with a Note covering
  the Linux implementation (syslog(3)), mirroring the existing QNX
  slogger2 note. No new requirement was needed since the existing
  System Backend requirements are already platform-generic.
- Add SyslogBackend to the shared backend class diagram
  (mw_log_recorders.puml), matching how SlogBackend is represented.
- Add a sequence diagram (syslog_backend_sequence.puml) showing a log
  call from LogStream construction through to the syslog(3) call.
- Add a detailed-design page (syslog_backend.md) describing the
  backend and embedding both diagrams, following the same structure
  as file_output_backend.md, and link it into the docs via the same
  symlink + toctree convention used for that page.
- Register the new files in the backend BUILD's architectural_design
  target.

Signed-off-by: Bharath Tirunagaru <bharatht@qti.qualcomm.com>
@btirunagaru

Copy link
Copy Markdown
Author

Thanks for the contribution. I would first request the following: Component requirements updated/added to clarify the expectation and understand how it could be achieved. Hence additionally supporting static/dynamic diagrams. Once this is finalized we can look into the source files. Please note that we are still in the migration phase of the repository from an internal one. Until we have established the quality gating and traceability of the requirements, no changes are merged here directly. In that regard we ask you for your patience. If you have questions please reach out to us in the Logging CFT: https://github.com/orgs/eclipse-score/discussions/3192

updated the component requirements and other documents as requested. please let us know the timeline for submission of this change. we require this support to deploy the product on the linux aarch64 on our targets- as we cannot ship the component with console logs enabled in our PDLC.

@rmaddikery

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I would first request the following: Component requirements updated/added to clarify the expectation and understand how it could be achieved. Hence additionally supporting static/dynamic diagrams. Once this is finalized we can look into the source files. Please note that we are still in the migration phase of the repository from an internal one. Until we have established the quality gating and traceability of the requirements, no changes are merged here directly. In that regard we ask you for your patience. If you have questions please reach out to us in the Logging CFT: https://github.com/orgs/eclipse-score/discussions/3192

updated the component requirements and other documents as requested. please let us know the timeline for submission of this change. we require this support to deploy the product on the linux aarch64 on our targets- as we cannot ship the component with console logs enabled in our PDLC.

Timeline is v1.0 as per: https://github.com/eclipse-score/score/milestones
If this is urgent, then we can try our best to include it after v0.9 is released

@btirunagaru

Copy link
Copy Markdown
Author

Thanks for the contribution. I would first request the following: Component requirements updated/added to clarify the expectation and understand how it could be achieved. Hence additionally supporting static/dynamic diagrams. Once this is finalized we can look into the source files. Please note that we are still in the migration phase of the repository from an internal one. Until we have established the quality gating and traceability of the requirements, no changes are merged here directly. In that regard we ask you for your patience. If you have questions please reach out to us in the Logging CFT: https://github.com/orgs/eclipse-score/discussions/3192

updated the component requirements and other documents as requested. please let us know the timeline for submission of this change. we require this support to deploy the product on the linux aarch64 on our targets- as we cannot ship the component with console logs enabled in our PDLC.

Timeline is v1.0 as per: https://github.com/eclipse-score/score/milestones If this is urgent, then we can try our best to include it after v0.9 is released

yes, this is needed to meet our internal timelines. I would appreciate ,if we can accommodate to release this in 0.9.
Assuming community will benefit from this as well. Relatively independent feature as its adding syslog (similar to slog for qnx - which is already present) capability . writing logs to a system syslog ( which is only invoked if the users go with kSystem ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

feat: Add Linux syslog backend for mw::log LogMode::kSystem

2 participants