Log: Add MaskAddress option to hide IP addresses (#3783)

* Log: Add maskAddress option

* Correct IPv6 subnet
This commit is contained in:
风扇滑翔翼 2024-09-11 22:45:47 +08:00 committed by GitHub
parent 6b1bf312d7
commit a247997e38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 91 additions and 17 deletions

View file

@ -16,10 +16,11 @@ func DefaultLogConfig() *log.Config {
}
type LogConfig struct {
AccessLog string `json:"access"`
ErrorLog string `json:"error"`
LogLevel string `json:"loglevel"`
DNSLog bool `json:"dnsLog"`
AccessLog string `json:"access"`
ErrorLog string `json:"error"`
LogLevel string `json:"loglevel"`
DNSLog bool `json:"dnsLog"`
MaskAddress string `json:"maskAddress"`
}
func (v *LogConfig) Build() *log.Config {
@ -59,5 +60,6 @@ func (v *LogConfig) Build() *log.Config {
default:
config.ErrorLogLevel = clog.Severity_Warning
}
config.MaskAddress = v.MaskAddress
return config
}