spring cloud disable the output log: ConfigClusterResolver: eureka endpoints via Resolving configuration

springcloud the registry client sends a heartbeat to the registry server at regular intervals, use this registry to determine whether the server is running normally.

This leads to ongoing log output, inconvenience view normal business log output.

c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration

Which method ConfigClusterResolver look at the output of the log

@Override    
public List<AwsEndpoint> getClusterEndpoints() {
        if (clientConfig.shouldUseDnsForFetchingServiceUrls()) {
            if (logger.isInfoEnabled()) {
                logger.info("Resolving eureka endpoints via DNS: {}", getDNSName());
            }
            return getClusterEndpointsFromDns();
        } else {
            logger.info("Resolving eureka endpoints via configuration");
            return getClusterEndpointsFromConfig();
        }
    }

So how to disable the output of the log it?

You can solve this problem by increasing the registry log output level, will be written into the configuration file as follows:

# Increase the log level is WARN 
logging: 
  Level: 
    com.netflix.discovery.shared.resolver.aws.ConfigClusterResolver: WARN

After addition of the above configuration, the period of time that no printing run or less info level log

Replicability: log output level can be specified in a class or package by a specified class logging.level + info / packet

logging.level.root = WARN #root log output level WARN 

This blog post from: https://github.com/spring-cloud/spring-cloud-netflix/issues/3365

Guess you like

Origin www.cnblogs.com/Small-sunshine/p/11724577.html