Class ConnectionStringMasker
Masks the secret values of a connection string, so that it can be written to a log.
public static class ConnectionStringMasker
- Inheritance
-
ConnectionStringMasker
- Inherited Members
Fields
UnreadableConnectionString
The text returned instead of a connection string that cannot be parsed.
public const string UnreadableConnectionString = "<unreadable connection string>"
Field Value
Methods
Mask(string?)
Replaces the value of every key of the connection string that carries a secret with a fixed-length mask.
public static string Mask(string? connectionString)
Parameters
connectionStringstringThe connection string.
Returns
- string
The connection string with its secret values masked, an empty string when it is empty, or UnreadableConnectionString when it cannot be parsed.