mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Format log naming
This commit is contained in:
parent
33e7cd6930
commit
a543be5f9f
@ -45,7 +45,7 @@ import static com.alibaba.nacos.api.PropertyKeyConst.*;
|
||||
@ConfigurationProperties("spring.cloud.nacos.discovery")
|
||||
public class NacosDiscoveryProperties {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(NacosDiscoveryProperties.class);
|
||||
|
||||
/**
|
||||
@ -401,7 +401,7 @@ public class NacosDiscoveryProperties {
|
||||
namingService = NacosFactory.createNamingService(properties);
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error("create naming service error!properties={},e=,", this, e);
|
||||
log.error("create naming service error!properties={},e=,", this, e);
|
||||
return null;
|
||||
}
|
||||
return namingService;
|
||||
|
@ -33,7 +33,7 @@ import java.util.*;
|
||||
*/
|
||||
public class NacosDiscoveryClient implements DiscoveryClient {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(NacosDiscoveryClient.class);
|
||||
public static final String DESCRIPTION = "Spring Cloud Nacos Discovery Client";
|
||||
|
||||
@ -100,7 +100,7 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
||||
return services.getData();
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error("get service name from nacos server fail,", e);
|
||||
log.error("get service name from nacos server fail,", e);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties;
|
||||
@Endpoint(id = "nacos-discovery")
|
||||
public class NacosDiscoveryEndpoint {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(NacosDiscoveryEndpoint.class);
|
||||
|
||||
private NacosDiscoveryProperties nacosDiscoveryProperties;
|
||||
@ -61,7 +61,7 @@ public class NacosDiscoveryEndpoint {
|
||||
subscribe = namingService.getSubscribeServices();
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error("get subscribe services from nacos fail,", e);
|
||||
log.error("get subscribe services from nacos fail,", e);
|
||||
}
|
||||
result.put("subscribe", subscribe);
|
||||
return result;
|
||||
|
@ -31,7 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class NacosAutoServiceRegistration
|
||||
extends AbstractAutoServiceRegistration<Registration> {
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(NacosAutoServiceRegistration.class);
|
||||
|
||||
private NacosRegistration registration;
|
||||
@ -65,7 +65,7 @@ public class NacosAutoServiceRegistration
|
||||
@Override
|
||||
protected void register() {
|
||||
if (!this.registration.getNacosDiscoveryProperties().isRegisterEnabled()) {
|
||||
LOGGER.debug("Registration disabled.");
|
||||
log.debug("Registration disabled.");
|
||||
return;
|
||||
}
|
||||
if (this.registration.getPort() < 0) {
|
||||
|
@ -31,7 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(NacosServiceRegistry.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(NacosServiceRegistry.class);
|
||||
|
||||
private final NacosDiscoveryProperties nacosDiscoveryProperties;
|
||||
|
||||
@ -46,7 +46,7 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
public void register(Registration registration) {
|
||||
|
||||
if (StringUtils.isEmpty(registration.getServiceId())) {
|
||||
logger.info("No service to register for nacos client...");
|
||||
log.info("No service to register for nacos client...");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -61,11 +61,11 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
|
||||
try {
|
||||
namingService.registerInstance(serviceId, instance);
|
||||
logger.info("nacos registry, {} {}:{} register finished", serviceId,
|
||||
log.info("nacos registry, {} {}:{} register finished", serviceId,
|
||||
instance.getIp(), instance.getPort());
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error("nacos registry, {} register failed...{},", serviceId,
|
||||
log.error("nacos registry, {} register failed...{},", serviceId,
|
||||
registration.toString(), e);
|
||||
}
|
||||
}
|
||||
@ -73,10 +73,10 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
@Override
|
||||
public void deregister(Registration registration) {
|
||||
|
||||
logger.info("De-registering from Nacos Server now...");
|
||||
log.info("De-registering from Nacos Server now...");
|
||||
|
||||
if (StringUtils.isEmpty(registration.getServiceId())) {
|
||||
logger.info("No dom to de-register for nacos client...");
|
||||
log.info("No dom to de-register for nacos client...");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -88,11 +88,11 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
registration.getPort(), nacosDiscoveryProperties.getClusterName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error("ERR_NACOS_DEREGISTER, de-register failed...{},",
|
||||
log.error("ERR_NACOS_DEREGISTER, de-register failed...{},",
|
||||
registration.toString(), e);
|
||||
}
|
||||
|
||||
logger.info("De-registration finished.");
|
||||
log.info("De-registration finished.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user