mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
fix: re-arrange console-sys to log properly in k8s/docker (#19129)
fixes #19125
This commit is contained in:
parent
8a698fef71
commit
92788e4cf4
@ -567,13 +567,6 @@ func (endpoints Endpoints) GetAllStrings() (all []string) {
|
|||||||
func hostResolveToLocalhost(endpoint Endpoint) bool {
|
func hostResolveToLocalhost(endpoint Endpoint) bool {
|
||||||
hostIPs, err := getHostIP(endpoint.Hostname())
|
hostIPs, err := getHostIP(endpoint.Hostname())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Log the message to console about the host resolving
|
|
||||||
reqInfo := (&logger.ReqInfo{}).AppendTags(
|
|
||||||
"host",
|
|
||||||
endpoint.Hostname(),
|
|
||||||
)
|
|
||||||
ctx := logger.SetReqInfo(GlobalContext, reqInfo)
|
|
||||||
logger.LogOnceIf(ctx, err, endpoint.Hostname(), logger.ErrorKind)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
var loopback int
|
var loopback int
|
||||||
@ -867,7 +860,7 @@ func (p PoolEndpointList) UpdateIsLocal() error {
|
|||||||
))
|
))
|
||||||
ctx := logger.SetReqInfo(GlobalContext,
|
ctx := logger.SetReqInfo(GlobalContext,
|
||||||
reqInfo)
|
reqInfo)
|
||||||
logger.LogOnceIf(ctx, err, endpoint.Hostname(), logger.ErrorKind)
|
logger.LogOnceIf(ctx, fmt.Errorf("Unable to resolve DNS for %s: %w", endpoint, err), endpoint.Hostname(), logger.ErrorKind)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
resolvedList[endpoint] = true
|
resolvedList[endpoint] = true
|
||||||
|
@ -651,6 +651,15 @@ func serverMain(ctx *cli.Context) {
|
|||||||
|
|
||||||
setDefaultProfilerRates()
|
setDefaultProfilerRates()
|
||||||
|
|
||||||
|
// Initialize globalConsoleSys system
|
||||||
|
bootstrapTrace("newConsoleLogger", func() {
|
||||||
|
globalConsoleSys = NewConsoleLogger(GlobalContext)
|
||||||
|
logger.AddSystemTarget(GlobalContext, globalConsoleSys)
|
||||||
|
|
||||||
|
// Set node name, only set for distributed setup.
|
||||||
|
globalConsoleSys.SetNodeName(globalLocalNodeName)
|
||||||
|
})
|
||||||
|
|
||||||
// Always load ENV variables from files first.
|
// Always load ENV variables from files first.
|
||||||
loadEnvVarsFromFiles()
|
loadEnvVarsFromFiles()
|
||||||
|
|
||||||
@ -672,15 +681,6 @@ func serverMain(ctx *cli.Context) {
|
|||||||
// the config file if not defined, set the default one.
|
// the config file if not defined, set the default one.
|
||||||
loadRootCredentials()
|
loadRootCredentials()
|
||||||
|
|
||||||
// Initialize globalConsoleSys system
|
|
||||||
bootstrapTrace("newConsoleLogger", func() {
|
|
||||||
globalConsoleSys = NewConsoleLogger(GlobalContext)
|
|
||||||
logger.AddSystemTarget(GlobalContext, globalConsoleSys)
|
|
||||||
|
|
||||||
// Set node name, only set for distributed setup.
|
|
||||||
globalConsoleSys.SetNodeName(globalLocalNodeName)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Perform any self-tests
|
// Perform any self-tests
|
||||||
bootstrapTrace("selftests", func() {
|
bootstrapTrace("selftests", func() {
|
||||||
bitrotSelfTest()
|
bitrotSelfTest()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user