namespace ZB.MOM.WW.Telemetry.Serilog; /// /// Seam for project-specific log-event redaction. The shared library applies this via /// ; each project provides its own implementation that knows which /// fields (by property name) or which command payloads must not leave the process in log events. /// If no is registered in DI, is a no-op. /// public interface ILogRedactor { /// /// Inspects and mutates the supplied log-event in place — remove /// or replace any sensitive values. Called on every log event before it reaches any sink. /// Both removing a key (the property is dropped from the event) and replacing its value are /// honoured by . /// /// Reach — top-level and nested. A scalar property (e.g. {apiKey}) appears as its /// unwrapped CLR value, which you can read and replace directly. A destructured property is /// projected into a mutable view you can descend into: a {@Object} arrives as an /// IDictionary<string, object?> of its fields, a logged collection as an /// IList<object?>, and a logged dictionary as an IDictionary<string, object?> /// keyed by the string form of each key — all recursively. You can therefore mask or remove a field /// nested inside a destructured object, for example: /// if (properties["command"] is IDictionary<string, object?> command) command["apiKey"] = "***"; /// The structure's type tag and a dictionary's original keys are preserved when the event is /// rebuilt, and properties you do not touch are left intact. /// /// /// The mutable property dictionary for the current log event. void Redact(IDictionary properties); }