Microsoft.IdentityModel.Logging Event source based logger to log different events. 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. Flag which indicates whether or not PII is shown in logs. False by default. Flag which indicates whether or not complete is shown in logs when is set to true. False by default. String that is used in place of any arguments to log messages if the 'ShowPII' flag is set to false. String that is used in place of any arguments to log messages if the 'LogCompleteSecurityArtifact' flag is set to false. Indicates whether or the log message header (contains library version, date/time, and PII debugging information) has been written. The log message that indicates the current library version. The log message that indicates the date. The log message that is shown when PII is off. The log message that is shown when PII is off. Writes an event log by using the provided string argument and current UTC time. No level filtering is done on the event. The log message. No level filtering. Writes an event log by using the provided string argument, current UTC time and the provided arguments list. The log message. An object array that contains zero or more objects to format. Writes a verbose event log by using the provided string argument and current UTC time. The log message. Writes a verbose event log by using the provided string argument, current UTC time and the provided arguments list. The log message. An object array that contains zero or more objects to format. Writes an information event log by using the provided string argument and current UTC time. The log message. Writes an information event log by using the provided string argument, current UTC time and the provided arguments list. The log message. An object array that contains zero or more objects to format. Writes a warning event log by using the provided string argument and current UTC time. The log message. Writes a warning event log by using the provided string argument, current UTC time and the provided arguments list. The log message. An object array that contains zero or more objects to format. Writes an error event log by using the provided string argument and current UTC time. The log message. Writes an error event log by using the provided string argument, current UTC time and the provided arguments list. The log message. An object array that contains zero or more objects to format. Writes a critical event log by using the provided string argument and current UTC time. The log message. Writes a critical event log by using the provided string argument, current UTC time and the provided arguments list. The log message. An object array that contains zero or more objects to format. Writes an exception log by using the provided event identifer, exception argument, string argument and current UTC time. The log message. Writes an exception log by using the provided event identifer, exception argument, string argument, arguments list and current UTC time. The log message. An object array that contains zero or more objects to format. Minimum log level to log events. Default is Warning. Provides a way to add and remove telemetry data. Get the string that represents the client SKU. Get the string that represents the client version. Adds a key and its value to the collection of telemetry data. The name of the telemetry. The value of the telemetry. true if the key is successfully added; otherwise, false. Removes a key and its value from the collection of telemetry data. The name of the telemetry. true if the key is successfully removed; otherwise, false. Interface that provides an unsafe method to log a security artifact. SecurityToken and encoded token are considered as SecurityArtifacts. Returns a string that represents the complete security artifact. This may include sensitive information and should only be used for debugging purposes. A context class that can be used to store work per request to aid with debugging. Instantiates a new with the default activityId. Instantiates a new with an activityId. Gets or set a that will be used in the call to EventSource.SetCurrentThreadActivityId before logging. Gets or sets a boolean controlling if logs are written into the context. Useful when debugging. Gets or sets a string that helps with setting breakpoints when debugging. The collection of logs associated with a request. Use to control capture. Gets or sets an that enables custom extensibility scenarios. Helper class for logging. Gets or sets a logger to which logs will be written to. Indicates whether the log message header (contains library version, date/time, and PII debugging information) has been written. The log message that is shown when PII is off. The log message that is shown when PII is on. Gets whether logging is enabled at the specified ."/> The log level if logging is enabled at the specified level; otherwise, . Logs an exception using the event source logger and returns new exception. argument that is null or empty. EventLevel is set to Error. Logs an exception using the event source logger and returns new typed exception. message to log. EventLevel is set to Error. Logs an argument exception using the event source logger and returns new typed exception. Identifies the argument whose value generated the ArgumentException. message to log. EventLevel is set to Error. Logs an exception using the event source logger and returns new typed exception. Format string of the log message. An object array that contains zero or more objects to format. EventLevel is set to Error. Logs an argument exception using the event source logger and returns new typed exception. Identifies the argument whose value generated the ArgumentException. Format string of the log message. An object array that contains zero or more objects to format. EventLevel is set to Error. Logs an exception using the event source logger and returns new typed exception. the inner to be added to the outer exception. message to log. EventLevel is set to Error. Logs an argument exception using the event source logger and returns new typed exception. Identifies the argument whose value generated the ArgumentException. the inner to be added to the outer exception. message to log. EventLevel is set to Error. Logs an exception using the event source logger and returns new typed exception. the inner to be added to the outer exception. Format string of the log message. An object array that contains zero or more objects to format. EventLevel is set to Error. Logs an argument exception using the event source logger and returns new typed exception. Identifies the argument whose value generated the ArgumentException. the inner to be added to the outer exception. Format string of the log message. An object array that contains zero or more objects to format. EventLevel is set to Error. Logs an exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. message to log. Logs an argument exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. Identifies the argument whose value generated the ArgumentException. message to log. Logs an exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. Format string of the log message. An object array that contains zero or more objects to format. Logs an argument exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. Identifies the argument whose value generated the ArgumentException. Format string of the log message. An object array that contains zero or more objects to format. Logs an exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. the inner to be added to the outer exception. message to log. Logs an argument exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. Identifies the argument whose value generated the ArgumentException. the inner to be added to the outer exception. message to log. Logs an exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. the inner to be added to the outer exception. Format string of the log message. An object array that contains zero or more objects to format. Logs an argument exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. Identifies the argument whose value generated the ArgumentException. the inner to be added to the outer exception. Format string of the log message. An object array that contains zero or more objects to format. Logs an exception using the event source logger. The exception to log. Logs an exception using the event source logger. Identifies the level of an event to be logged. The exception to log. Logs an information event. The log message. An object array that contains zero or more objects to format. Logs a verbose event. The log message. An object array that contains zero or more objects to format. Logs a warning event. The log message. An object array that contains zero or more objects to format. Logs an exception using the event source logger and returns new typed exception. Identifies the level of an event to be logged. Identifies the argument whose value generated the ArgumentException. the inner to be added to the outer exception. Format string of the log message. An object array that contains zero or more objects to format. Formats the string using InvariantCulture Format string. Format arguments. Formatted string. Marks a log message argument () as NonPII. A log message argument to be marked as NonPII. An argument marked as NonPII. Marking an argument as NonPII in calls will result in logging that argument in cleartext, regardless of the flag value. Marks a log message argument () as SecurityArtifact. A log message argument to be marked as SecurityArtifact. A callback function to log the security artifact safely. An argument marked as SecurityArtifact. Since even the payload may sometimes contain security artifacts, naïve disarm algorithms such as removing signatures will not work. For now the will only be leveraged if is set and no unsafe callback is provided. Future changes may introduce a support for best effort disarm logging. Marks a log message argument () as SecurityArtifact. A log message argument to be marked as SecurityArtifact. A callback function to log the security artifact safely. A callback function to log the security artifact without scrubbing. An argument marked as SecurityArtifact. if is null. if is null. Since even the payload may sometimes contain security artifacts, naïve disarm algorithms such as removing signatures will not work. For now the is currently unused. Future changes may introduce a support for best effort disarm logging which will leverage . Marks a log message argument () as SecurityArtifact. A log message argument to be marked as SecurityArtifact. A callback function to log the security artifact without scrubbing. An argument marked as SecurityArtifact. if is null. Creates a by using the provided event level, exception argument, string argument and arguments list. The log message. An object array that contains zero or more objects to format. Log messages and codes for Microsoft.IdentityModel.Logging An internal structure that is used to mark an argument as NonPII. Arguments wrapped with a NonPII structure will be considered as NonPII in the message logging process. Argument wrapped with a structure is considered as NonPII in the message logging process. Creates an instance of that wraps the . An argument that is considered as NonPII. Returns a string that represents the . Null if the is , otherwise calls method of the . An internal structure that is used to mark an argument as SecurityArtifact. Arguments wrapped with a SecurityArtifact structure will be considered as a SecurityArtifact in the message logging process. SecurityToken and encoded token are considered as SecurityArtifacts. Argument wrapped with a structure is considered as SecurityArtifact in the message logging process. The ToString callback delegate that returns a disarmed SecurityArtifact. The ToString callback delegate that returns an unscrubbed SecurityArtifact. Creates an instance of that wraps the . An argument that is considered as SecurityArtifact. A callback used to disarm the token. Since even the payload may sometimes contain security artifacts, naïve disarm algorithms (such as removing signatures in the case of JWTs) will not work. For now the will only be leveraged if is set and no unsafe callback is provided. Future changes may introduce a support for best effort disarm logging. Creates an instance of that wraps the . An argument that is considered as SecurityArtifact. A ToString callback. A ToString callback which will return the unscrubbed artifact. Since even the payload may sometimes contain security artifacts, naïve disarm algorithms (such as removing signatures in the case of JWTs) will not work. For now the is currently unused. Future changes may introduce a support for best effort disarm logging which will leverage . A dummy callback which can be leveraged to return a standard scrubbed token in the case where expected token is unknown. Ignored token. The standard scrubbed token string. Returns a string that represents the . Null if the is , otherwise calls the provided safe callback on . Event listener that writes logs to a file or a fileStream provided by user. Name of the default log file, excluding its path. Initializes a new instance of that writes logs to text file. Initializes a new instance of that writes logs to text file. location of the file where log messages will be written. Initializes a new instance of that writes logs to text file. StreamWriter where logs will be written. Called whenever an event has been written by an event source for which the event listener has enabled events. Releases all resources used by the current instance of the class.