Apq.Cfg.MergedCfgRoot.GetMasked(string).md 810 B

Apq.Cfg

Apq.Cfg.MergedCfgRoot

MergedCfgRoot.GetMasked(string) Method

获取脱敏后的配置值(用于日志输出)

public string GetMasked(string key);

Parameters

key System.String

配置键

Returns

System.String
脱敏后的值

Example

// 日志输出时使用脱敏值
logger.LogInformation("连接字符串: {ConnectionString}", cfg.GetMasked("Database:ConnectionString"));
// 输出: 连接字符串: Ser***ion