<PackageReference Include="Microsoft.IdentityModel.Logging" Version="8.19.1" />

Microsoft.IdentityModel.Logging.IdentityModelEventSource

Event source based logger to log different events.
public static bool HeaderWritten { get; set; }

Indicates whether or the log message header (contains library version, date/time, and PII debugging information) has been written.

public static string HiddenPIIString { get; }

String that is used in place of any arguments to log messages if the 'ShowPII' flag is set to false.

public static string HiddenSecurityArtifactString { get; }

String that is used in place of any arguments to log messages if the 'LogCompleteSecurityArtifact' flag is set to false.

public static bool LogCompleteSecurityArtifact { get; set; }

Flag which indicates whether or not complete SecurityArtifact is shown in logs when ShowPII is set to true. False by default.

public static IdentityModelEventSource Logger { get; }

Static logger that is exposed externally. An external application or framework can hook up a listener to this event source to log data in a custom way.

public static bool ShowPII { get; set; }

Flag which indicates whether or not PII is shown in logs. False by default.

public EventLevel LogLevel { get; set; }

Minimum log level to log events. Default is Warning.

public void Write(EventLevel level, Exception innerException, string message)

Writes an exception log by using the provided event identifer, exception argument, string argument and current UTC time.

public void Write(EventLevel level, Exception innerException, string message, object[] args)

Writes an exception log by using the provided event identifer, exception argument, string argument, arguments list and current UTC time.

public void WriteAlways(string message)

Writes an event log by using the provided string argument and current UTC time. No level filtering is done on the event.

public void WriteAlways(string message, object[] args)

Writes an event log by using the provided string argument, current UTC time and the provided arguments list.

public void WriteCritical(string message)

Writes a critical event log by using the provided string argument and current UTC time.

public void WriteCritical(string message, object[] args)

Writes a critical event log by using the provided string argument, current UTC time and the provided arguments list.

public void WriteError(string message)

Writes an error event log by using the provided string argument and current UTC time.

public void WriteError(string message, object[] args)

Writes an error event log by using the provided string argument, current UTC time and the provided arguments list.

public void WriteInformation(string message)

Writes an information event log by using the provided string argument and current UTC time.

public void WriteInformation(string message, object[] args)

Writes an information event log by using the provided string argument, current UTC time and the provided arguments list.

public void WriteVerbose(string message)

Writes a verbose event log by using the provided string argument and current UTC time.

public void WriteVerbose(string message, object[] args)

Writes a verbose event log by using the provided string argument, current UTC time and the provided arguments list.

public void WriteWarning(string message)

Writes a warning event log by using the provided string argument and current UTC time.

public void WriteWarning(string message, object[] args)

Writes a warning event log by using the provided string argument, current UTC time and the provided arguments list.