Skip to content

Improve NetOffice Logging Architecture#500

Description

@jozefizso

What to build

Design and deliver a provider-neutral NetOffice logging architecture that lets each final application select its own logging implementation without making NetOfficeFw.Core depend on Microsoft Extensions Logging, Serilog, NLog, or another third-party logging framework.

The core contract must support per-Core logger configuration and preserve the existing DebugConsole experience when an application does not opt into an external logger. Log records must retain their level, category, stable event identifier and name, message template, structured arguments, and original exception. The architecture must remain compatible with the current .NET Framework target and strong-named assemblies.

Logging is an observability side effect: provider failures must not change a COM operation's result or exception. Implementations must be thread-safe, must check level enablement before formatting or allocating avoidable state, and must leave provider configuration, buffering, flushing, and disposal under application ownership. Sensitive COM argument values and document contents must not be logged by default.

Preserve the public DebugConsole, Core.Console, and ICOMObject.Console compatibility surface. Do not add a logger member to ICOMObject, because that would break external implementations. Existing static and per-core diagnostic paths must eventually reach the configured provider-neutral logger without duplicate exception reporting.

Optional adapters are separate opt-in packages and direct children of this Epic:

  • Microsoft Extensions Logging
  • Serilog
  • NLog

An application may choose a native adapter or route Serilog/NLog through the Microsoft Extensions Logging adapter, but guidance must prevent configuring both paths for the same Core and producing duplicate events.

Acceptance criteria

  • NetOfficeFw.Core exposes only NetOffice-owned logging contracts and has no dependency on an external logging framework.
  • An application can select a logger per Core; the default behavior remains compatible with DebugConsole.
  • Records preserve structured templates and arguments, category, level, stable event ID/name, and the original exception.
  • Disabled logging avoids formatting and avoidable event allocations.
  • A throwing or failing logger cannot alter NetOffice COM behavior.
  • NetOffice does not configure or dispose application-owned logging infrastructure.
  • The design defines consistent level, category, event-ID, and sensitive-data policies.
  • Public compatibility is maintained for DebugConsole, Core.Console, and ICOMObject.Console.
  • Adapter packages support the repository's .NET Framework and strong-name requirements.
  • Microsoft Extensions Logging, Serilog, and NLog adapter subtickets satisfy their provider-specific acceptance criteria.

Blocked by

  • None (can start immediately).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions