You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide an optional native NetOffice adapter for Serilog. A final application supplies an application-owned Serilog.ILogger; the adapter exposes it through the provider-neutral NetOffice logging contract without requiring Microsoft Extensions Logging, a Serilog sink, or Serilog in NetOfficeFw.Core.
The adapter derives and caches a logger for each NetOffice category using Serilog's standard SourceContext property. It maps NetOffice levels to native Serilog levels, attaches the stable numeric event ID and event name as structured EventId and EventName properties, forwards the original exception, and writes the original NetOffice message template and arguments through Serilog's native template pipeline.
Level enablement must be checked before constructing avoidable event state or enriching a disabled event. The adapter must not assign or mutate the global Log.Logger, configure sinks or minimum levels, flush the pipeline, or dispose the supplied logger. The application's Serilog configuration and lifecycle remain authoritative.
The package depends only on NetOfficeFw.Core and Serilog's core package. It must not reference MEL or any sink package. Its public configuration API must accept a specific logger and configure a specific Core, with ownership behavior stated explicitly. It must remain compatible with the repository's .NET Framework and strong-name requirements.
Documentation must distinguish this native route from Serilog's MEL provider used with the Microsoft Extensions Logging adapter. Configuring both routes for one Core must be explicitly discouraged because it can duplicate every event.
Acceptance criteria
Installing this package is optional and does not add Serilog to NetOfficeFw.Core.
The adapter has no MEL or concrete sink dependency.
An application can configure a specific Core from an application-owned Serilog.ILogger.
NetOffice categories map to cached Serilog loggers enriched with SourceContext.
Every NetOffice level maps to the intended native Serilog level and respects native enablement.
Numeric event ID and event name are retained as structured EventId and EventName properties.
Named message-template arguments remain native Serilog properties rather than a preformatted string.
The exact original exception reaches the Serilog event.
Disabled events avoid unnecessary enrichment, argument processing, and sink invocation.
The adapter does not mutate global Serilog state, configure sinks, flush, or dispose the supplied logger.
Tests use a test-owned capturing sink to verify category, level, event properties, message-template properties, exception identity, filtering, and logger failure isolation.
Package output is compatible with the repository's .NET Framework target and signing conventions.
Usage guidance explains native Serilog versus Serilog-through-MEL and prevents accidental double logging.
Parent
What to build
Provide an optional native NetOffice adapter for Serilog. A final application supplies an application-owned
Serilog.ILogger; the adapter exposes it through the provider-neutral NetOffice logging contract without requiring Microsoft Extensions Logging, a Serilog sink, or Serilog inNetOfficeFw.Core.The adapter derives and caches a logger for each NetOffice category using Serilog's standard
SourceContextproperty. It maps NetOffice levels to native Serilog levels, attaches the stable numeric event ID and event name as structuredEventIdandEventNameproperties, forwards the original exception, and writes the original NetOffice message template and arguments through Serilog's native template pipeline.Level enablement must be checked before constructing avoidable event state or enriching a disabled event. The adapter must not assign or mutate the global
Log.Logger, configure sinks or minimum levels, flush the pipeline, or dispose the supplied logger. The application's Serilog configuration and lifecycle remain authoritative.The package depends only on
NetOfficeFw.Coreand Serilog's core package. It must not reference MEL or any sink package. Its public configuration API must accept a specific logger and configure a specificCore, with ownership behavior stated explicitly. It must remain compatible with the repository's .NET Framework and strong-name requirements.Documentation must distinguish this native route from Serilog's MEL provider used with the Microsoft Extensions Logging adapter. Configuring both routes for one
Coremust be explicitly discouraged because it can duplicate every event.Acceptance criteria
NetOfficeFw.Core.Corefrom an application-ownedSerilog.ILogger.SourceContext.EventIdandEventNameproperties.Blocked by