mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Add new console/http loggers (#6066)
- Add console target logging, enabled by default. - Add http target logging, which supports an endpoint with basic authentication (username/password are passed in the endpoint url itself) - HTTP target logging is asynchronous and some logs can be dropped if channel buffer (10000) is full
This commit is contained in:
@@ -41,9 +41,9 @@ import (
|
||||
// 6. Make changes in config-current_test.go for any test change
|
||||
|
||||
// Config version
|
||||
const serverConfigVersion = "26"
|
||||
const serverConfigVersion = "27"
|
||||
|
||||
type serverConfig = serverConfigV26
|
||||
type serverConfig = serverConfigV27
|
||||
|
||||
var (
|
||||
// globalServerConfig server config.
|
||||
@@ -260,6 +260,8 @@ func (s *serverConfig) ConfigDiff(t *serverConfig) string {
|
||||
return "MySQL Notification configuration differs"
|
||||
case !reflect.DeepEqual(s.Notify.MQTT, t.Notify.MQTT):
|
||||
return "MQTT Notification configuration differs"
|
||||
case !reflect.DeepEqual(s.Logger, t.Logger):
|
||||
return "Logger configuration differs"
|
||||
case reflect.DeepEqual(s, t):
|
||||
return ""
|
||||
default:
|
||||
@@ -315,6 +317,13 @@ func newServerConfig() *serverConfig {
|
||||
srvCfg.Cache.Exclude = make([]string, 0)
|
||||
srvCfg.Cache.Expiry = globalCacheExpiry
|
||||
srvCfg.Cache.MaxUse = globalCacheMaxUse
|
||||
|
||||
// Console logging is on by default
|
||||
srvCfg.Logger.Console.Enabled = true
|
||||
// Create an example of HTTP logger
|
||||
srvCfg.Logger.HTTP = make(map[string]loggerHTTP)
|
||||
srvCfg.Logger.HTTP["target1"] = loggerHTTP{Endpoint: "https://username:password@example.com/api"}
|
||||
|
||||
return srvCfg
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user