Parcourir la source

Optimize logging statements using placeholder (#1736)

* Optimize logging statements using placeholder to avoid unnecessary concatenation (issue #1735)
master
nickChenyx GitHub il y a 4 ans
Parent
révision
cc2d1a69a9
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 4AEE18F83AFDEB23
47 fichiers modifiés avec 97 ajouts et 102 suppressions
  1. +4
    -4
      sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/api/GatewayApiDefinitionManager.java
  2. +2
    -2
      sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/command/UpdateGatewayRuleCommandHandler.java
  3. +3
    -3
      sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/rule/GatewayRuleManager.java
  4. +2
    -2
      sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/DefaultClusterTokenClient.java
  5. +2
    -3
      sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/NettyTransportClient.java
  6. +4
    -2
      sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/codec/ClientEntityCodecProvider.java
  7. +3
    -3
      sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/config/ClusterClientConfigManager.java
  8. +3
    -3
      sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/handler/TokenClientHandler.java
  9. +1
    -1
      sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/command/handler/ModifyClusterClientConfigHandler.java
  10. +2
    -2
      sentinel-cluster/sentinel-cluster-common-default/src/main/java/com/alibaba/csp/sentinel/cluster/registry/ConfigSupplierRegistry.java
  11. +1
    -1
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/flow/statistic/concurrent/expire/RegularExpireStrategy.java
  12. +1
    -1
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/NettyTransportServer.java
  13. +4
    -6
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/codec/ServerEntityCodecProvider.java
  14. +1
    -1
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/command/handler/ModifyClusterServerFlowConfigHandler.java
  15. +1
    -1
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/command/handler/ModifyServerNamespaceSetHandler.java
  16. +5
    -5
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/config/ClusterServerConfigManager.java
  17. +2
    -4
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/connection/ScanIdleConnectionTask.java
  18. +1
    -1
      sentinel-cluster/sentinel-cluster-server-envoy-rls/src/main/java/com/alibaba/csp/sentinel/cluster/server/envoy/rls/rule/EnvoyRlsRuleManager.java
  19. +2
    -2
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/cluster/client/TokenClientProvider.java
  20. +2
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/cluster/server/EmbeddedClusterTokenServerProvider.java
  21. +1
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/config/SentinelConfig.java
  22. +1
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/config/SentinelConfigLoader.java
  23. +3
    -3
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/init/InitExecutor.java
  24. +1
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/metric/extension/MetricExtensionProvider.java
  25. +1
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/IntervalProperty.java
  26. +3
    -3
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/OccupyTimeoutProperty.java
  27. +1
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/SampleCountProperty.java
  28. +6
    -7
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricWriter.java
  29. +1
    -1
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/property/DynamicSentinelProperty.java
  30. +2
    -2
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/slotchain/SlotChainProvider.java
  31. +4
    -4
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/authority/AuthorityRuleManager.java
  32. +4
    -4
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRuleManager.java
  33. +2
    -2
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowRuleManager.java
  34. +2
    -2
      sentinel-extension/sentinel-datasource-apollo/src/main/java/com/alibaba/csp/sentinel/datasource/apollo/ApolloDataSource.java
  35. +1
    -1
      sentinel-extension/sentinel-datasource-extension/src/main/java/com/alibaba/csp/sentinel/datasource/FileWritableDataSource.java
  36. +2
    -2
      sentinel-extension/sentinel-datasource-nacos/src/main/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java
  37. +1
    -1
      sentinel-extension/sentinel-datasource-redis/src/main/java/com/alibaba/csp/sentinel/datasource/redis/RedisDataSource.java
  38. +3
    -4
      sentinel-extension/sentinel-datasource-spring-cloud-config/src/main/java/com/alibaba/csp/sentinel/datasource/spring/cloud/config/SentinelRuleLocator.java
  39. +2
    -2
      sentinel-extension/sentinel-datasource-zookeeper/src/main/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSource.java
  40. +1
    -1
      sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/command/handler/ModifyParamFlowRulesCommandHandler.java
  41. +2
    -2
      sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowRuleManager.java
  42. +2
    -2
      sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParameterMetricStorage.java
  43. +1
    -1
      sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/CommandCenterProvider.java
  44. +1
    -1
      sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/cluster/ModifyClusterModeCommandHandler.java
  45. +1
    -1
      sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/heartbeat/HeartbeatSenderProvider.java
  46. +1
    -2
      sentinel-transport/sentinel-transport-netty-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/HttpHeartbeatSender.java
  47. +1
    -1
      sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/SimpleHttpHeartbeatSender.java

+ 4
- 4
sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/api/GatewayApiDefinitionManager.java Voir le fichier

@@ -62,8 +62,8 @@ public final class GatewayApiDefinitionManager {
List<ApiDefinitionChangeObserver> listeners = SpiLoader.loadInstanceList(ApiDefinitionChangeObserver.class);
for (ApiDefinitionChangeObserver e : listeners) {
API_CHANGE_OBSERVERS.put(e.getClass().getCanonicalName(), e);
RecordLog.info("[GatewayApiDefinitionManager] ApiDefinitionChangeObserver added: "
+ e.getClass().getCanonicalName());
RecordLog.info("[GatewayApiDefinitionManager] ApiDefinitionChangeObserver added: {}"
, e.getClass().getCanonicalName());
}
}

@@ -103,13 +103,13 @@ public final class GatewayApiDefinitionManager {
@Override
public void configUpdate(Set<ApiDefinition> set) {
applyApiUpdateInternal(set);
RecordLog.info("[GatewayApiDefinitionManager] Api definition updated: " + API_MAP);
RecordLog.info("[GatewayApiDefinitionManager] Api definition updated: {}", API_MAP);
}

@Override
public void configLoad(Set<ApiDefinition> set) {
applyApiUpdateInternal(set);
RecordLog.info("[GatewayApiDefinitionManager] Api definition loaded: " + API_MAP);
RecordLog.info("[GatewayApiDefinitionManager] Api definition loaded: {}", API_MAP);
}

private static synchronized void applyApiUpdateInternal(Set<ApiDefinition> set) {


+ 2
- 2
sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/command/UpdateGatewayRuleCommandHandler.java Voir le fichier

@@ -51,7 +51,7 @@ public class UpdateGatewayRuleCommandHandler implements CommandHandler<String> {
return CommandResponse.ofFailure(e, "decode gateway rule data error");
}

RecordLog.info(String.format("[API Server] Receiving rule change (type: gateway rule): %s", data));
RecordLog.info("[API Server] Receiving rule change (type: gateway rule): {}", data);

String result = SUCCESS_MSG;
Set<GatewayFlowRule> flowRules = JSON.parseObject(data, new TypeReference<Set<GatewayFlowRule>>() {
@@ -93,4 +93,4 @@ public class UpdateGatewayRuleCommandHandler implements CommandHandler<String> {

private static final String SUCCESS_MSG = "success";
private static final String WRITE_DS_FAILURE_MSG = "partial success (write data source failed)";
}
}

+ 3
- 3
sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/rule/GatewayRuleManager.java Voir le fichier

@@ -149,13 +149,13 @@ public final class GatewayRuleManager {
@Override
public void configUpdate(Set<GatewayFlowRule> conf) {
applyGatewayRuleInternal(conf);
RecordLog.info("[GatewayRuleManager] Gateway flow rules received: " + GATEWAY_RULE_MAP);
RecordLog.info("[GatewayRuleManager] Gateway flow rules received: {}", GATEWAY_RULE_MAP);
}

@Override
public void configLoad(Set<GatewayFlowRule> conf) {
applyGatewayRuleInternal(conf);
RecordLog.info("[GatewayRuleManager] Gateway flow rules loaded: " + GATEWAY_RULE_MAP);
RecordLog.info("[GatewayRuleManager] Gateway flow rules loaded: {}", GATEWAY_RULE_MAP);
}

private int getIdxInternal(Map<String, Integer> idxMap, String resourceName) {
@@ -271,7 +271,7 @@ public final class GatewayRuleManager {
CONVERTED_PARAM_RULE_MAP.clear();
CONVERTED_PARAM_RULE_MAP.putAll(newRuleMap);

RecordLog.info("[GatewayRuleManager] Converted internal param rules: " + CONVERTED_PARAM_RULE_MAP);
RecordLog.info("[GatewayRuleManager] Converted internal param rules: {}", CONVERTED_PARAM_RULE_MAP);
}
}
}

+ 2
- 2
sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/DefaultClusterTokenClient.java Voir le fichier

@@ -79,7 +79,7 @@ public class DefaultClusterTokenClient implements ClusterTokenClient {
try {
this.transportClient = new NettyTransportClient(host, port);
this.serverDescriptor = new TokenServerDescriptor(host, port);
RecordLog.info("[DefaultClusterTokenClient] New client created: " + serverDescriptor);
RecordLog.info("[DefaultClusterTokenClient] New client created: {}", serverDescriptor);
} catch (Exception ex) {
RecordLog.warn("[DefaultClusterTokenClient] Failed to initialize new token client", ex);
}
@@ -97,7 +97,7 @@ public class DefaultClusterTokenClient implements ClusterTokenClient {
this.transportClient = new NettyTransportClient(config.getServerHost(), config.getServerPort());
this.serverDescriptor = new TokenServerDescriptor(config.getServerHost(), config.getServerPort());
startClientIfScheduled();
RecordLog.info("[DefaultClusterTokenClient] New client created: " + serverDescriptor);
RecordLog.info("[DefaultClusterTokenClient] New client created: {}", serverDescriptor);
} catch (Exception ex) {
RecordLog.warn("[DefaultClusterTokenClient] Failed to change remote token server", ex);
}


+ 2
- 3
sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/NettyTransportClient.java Voir le fichier

@@ -126,8 +126,7 @@ public class NettyTransportClient implements ClusterTransportClient {
} else {
failConnectedTime.set(0);
channel = future.channel();
RecordLog.info(
"[NettyTransportClient] Successfully connect to server <" + host + ":" + port + ">");
RecordLog.info("[NettyTransportClient] Successfully connect to server <{}:{}>", host, port);
}
}
});
@@ -144,7 +143,7 @@ public class NettyTransportClient implements ClusterTransportClient {
@Override
public void run() {
if (shouldRetry.get()) {
RecordLog.info("[NettyTransportClient] Reconnecting to server <" + host + ":" + port + ">");
RecordLog.info("[NettyTransportClient] Reconnecting to server <{}:{}>", host, port);
try {
startInternal();
} catch (Exception e) {


+ 4
- 2
sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/codec/ClientEntityCodecProvider.java Voir le fichier

@@ -39,14 +39,16 @@ public final class ClientEntityCodecProvider {
RecordLog.warn("[ClientEntityCodecProvider] No existing request entity writer, resolve failed");
} else {
requestEntityWriter = writer;
RecordLog.info("[ClientEntityCodecProvider] Request entity writer resolved: " + requestEntityWriter.getClass().getCanonicalName());
RecordLog.info("[ClientEntityCodecProvider] Request entity writer resolved: {}",
requestEntityWriter.getClass().getCanonicalName());
}
ResponseEntityDecoder decoder = SpiLoader.loadFirstInstance(ResponseEntityDecoder.class);
if (decoder == null) {
RecordLog.warn("[ClientEntityCodecProvider] No existing response entity decoder, resolve failed");
} else {
responseEntityDecoder = decoder;
RecordLog.info("[ClientEntityCodecProvider] Response entity decoder resolved: " + responseEntityDecoder.getClass().getCanonicalName());
RecordLog.info("[ClientEntityCodecProvider] Response entity decoder resolved: {}",
responseEntityDecoder.getClass().getCanonicalName());
}
}



+ 3
- 3
sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/config/ClusterClientConfigManager.java Voir le fichier

@@ -131,7 +131,7 @@ public final class ClusterClientConfigManager {
return;
}

RecordLog.info("[ClusterClientConfigManager] Assign to new target token server: " + config);
RecordLog.info("[ClusterClientConfigManager] Assign to new target token server: {}", config);

updateServerAssignment(config);
}
@@ -156,11 +156,11 @@ public final class ClusterClientConfigManager {
private synchronized void applyConfig(ClusterClientConfig config) {
if (!isValidClientConfig(config)) {
RecordLog.warn(
"[ClusterClientConfigManager] Invalid cluster client config, ignoring: " + config);
"[ClusterClientConfigManager] Invalid cluster client config, ignoring: {}", config);
return;
}

RecordLog.info("[ClusterClientConfigManager] Updating to new client config: " + config);
RecordLog.info("[ClusterClientConfigManager] Updating to new client config: {}", config);

updateClientConfigChange(config);
}


+ 3
- 3
sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/handler/TokenClientHandler.java Voir le fichier

@@ -48,7 +48,7 @@ public class TokenClientHandler extends ChannelInboundHandlerAdapter {
public void channelActive(ChannelHandlerContext ctx) throws Exception {
currentState.set(ClientConstants.CLIENT_STATUS_STARTED);
fireClientPing(ctx);
RecordLog.info("[TokenClientHandler] Client handler active, remote address: " + getRemoteAddress(ctx));
RecordLog.info("[TokenClientHandler] Client handler active, remote address: {}", getRemoteAddress(ctx));
}

@Override
@@ -90,12 +90,12 @@ public class TokenClientHandler extends ChannelInboundHandlerAdapter {

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
RecordLog.info("[TokenClientHandler] Client handler inactive, remote address: " + getRemoteAddress(ctx));
RecordLog.info("[TokenClientHandler] Client handler inactive, remote address: {}", getRemoteAddress(ctx));
}

@Override
public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
RecordLog.info("[TokenClientHandler] Client channel unregistered, remote address: " + getRemoteAddress(ctx));
RecordLog.info("[TokenClientHandler] Client channel unregistered, remote address: {}", getRemoteAddress(ctx));
currentState.set(ClientConstants.CLIENT_STATUS_OFF);

disconnectCallback.run();


+ 1
- 1
sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/command/handler/ModifyClusterClientConfigHandler.java Voir le fichier

@@ -44,7 +44,7 @@ public class ModifyClusterClientConfigHandler implements CommandHandler<String>
}
try {
data = URLDecoder.decode(data, "utf-8");
RecordLog.info("[ModifyClusterClientConfigHandler] Receiving cluster client config: " + data);
RecordLog.info("[ModifyClusterClientConfigHandler] Receiving cluster client config: {}", data);
ClusterClientStateEntity entity = JSON.parseObject(data, ClusterClientStateEntity.class);

ClusterClientConfigManager.applyNewConfig(entity.toClientConfig());


+ 2
- 2
sentinel-cluster/sentinel-cluster-common-default/src/main/java/com/alibaba/csp/sentinel/cluster/registry/ConfigSupplierRegistry.java Voir le fichier

@@ -52,8 +52,8 @@ public final class ConfigSupplierRegistry {
public static void setNamespaceSupplier(Supplier<String> namespaceSupplier) {
AssertUtil.notNull(namespaceSupplier, "namespaceSupplier cannot be null");
ConfigSupplierRegistry.namespaceSupplier = namespaceSupplier;
RecordLog.info("[ConfigSupplierRegistry] New namespace supplier provided, current supplied: "
+ namespaceSupplier.get());
RecordLog.info("[ConfigSupplierRegistry] New namespace supplier provided, current supplied: {}",
namespaceSupplier.get());
}

private ConfigSupplierRegistry() {}


+ 1
- 1
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/flow/statistic/concurrent/expire/RegularExpireStrategy.java Voir le fichier

@@ -97,7 +97,7 @@ public class RegularExpireStrategy implements ExpireStrategy {
for (int i = 0; i < executeCount && i < keyList.size(); i++) {
// time out execution exit
if (System.currentTimeMillis() - start > executeDuration) {
RecordLog.info("[RegularExpireStrategy] End the process of expired token detection because of execute time is more than executeDuration:", executeDuration);
RecordLog.info("[RegularExpireStrategy] End the process of expired token detection because of execute time is more than executeDuration: {}", executeDuration);
break;
}
Long key = keyList.get(i);


+ 1
- 1
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/NettyTransportServer.java Voir le fichier

@@ -118,7 +118,7 @@ public class NettyTransportServer implements ClusterTokenServer {
RecordLog.info("[NettyTransportServer] Failed to start token server when retrying", e);
}
} else {
RecordLog.info("[NettyTransportServer] Token server started success at port " + port);
RecordLog.info("[NettyTransportServer] Token server started success at port {}", port);
currentState.compareAndSet(SERVER_STATUS_STARTING, SERVER_STATUS_STARTED);
}
}


+ 4
- 6
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/codec/ServerEntityCodecProvider.java Voir le fichier

@@ -39,18 +39,16 @@ public final class ServerEntityCodecProvider {
RecordLog.warn("[ServerEntityCodecProvider] No existing response entity writer, resolve failed");
} else {
responseEntityWriter = writer;
RecordLog.info(
"[ServerEntityCodecProvider] Response entity writer resolved: " + responseEntityWriter.getClass()
.getCanonicalName());
RecordLog.info("[ServerEntityCodecProvider] Response entity writer resolved: {}",
responseEntityWriter.getClass().getCanonicalName());
}
RequestEntityDecoder decoder = SpiLoader.loadFirstInstance(RequestEntityDecoder.class);
if (decoder == null) {
RecordLog.warn("[ServerEntityCodecProvider] No existing request entity decoder, resolve failed");
} else {
requestEntityDecoder = decoder;
RecordLog.info(
"[ServerEntityCodecProvider] Request entity decoder resolved: " + requestEntityDecoder.getClass()
.getCanonicalName());
RecordLog.info("[ServerEntityCodecProvider] Request entity decoder resolved: {}",
requestEntityDecoder.getClass().getCanonicalName());
}
}



+ 1
- 1
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/command/handler/ModifyClusterServerFlowConfigHandler.java Voir le fichier

@@ -46,7 +46,7 @@ public class ModifyClusterServerFlowConfigHandler implements CommandHandler<Stri
data = URLDecoder.decode(data, "utf-8");

if (StringUtil.isEmpty(namespace)) {
RecordLog.info("[ModifyClusterServerFlowConfigHandler] Receiving cluster server global flow config: " + data);
RecordLog.info("[ModifyClusterServerFlowConfigHandler] Receiving cluster server global flow config: {}", data);
ServerFlowConfig config = JSON.parseObject(data, ServerFlowConfig.class);
if (!ClusterServerConfigManager.isValidFlowConfig(config)) {
CommandResponse.ofFailure(new IllegalArgumentException("Bad flow config"));


+ 1
- 1
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/command/handler/ModifyServerNamespaceSetHandler.java Voir le fichier

@@ -44,7 +44,7 @@ public class ModifyServerNamespaceSetHandler implements CommandHandler<String> {
}
try {
data = URLDecoder.decode(data, "utf-8");
RecordLog.info("[ModifyServerNamespaceSetHandler] Receiving cluster server namespace set: " + data);
RecordLog.info("[ModifyServerNamespaceSetHandler] Receiving cluster server namespace set: {}", data);
Set<String> set = JSON.parseObject(data, new TypeReference<Set<String>>() {});
ClusterServerConfigManager.loadServerNamespaceSet(set);
return CommandResponse.ofSuccess("success");


+ 5
- 5
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/config/ClusterServerConfigManager.java Voir le fichier

@@ -219,7 +219,7 @@ public final class ClusterServerConfigManager {
if (newSet == null) {
return;
}
RecordLog.info("[ClusterServerConfigManager] Server namespace set will be update to: " + newSet);
RecordLog.info("[ClusterServerConfigManager] Server namespace set will be update to: {}", newSet);
if (newSet.isEmpty()) {
ClusterServerConfigManager.namespaceSet = Collections.singleton(ServerConstants.DEFAULT_NAMESPACE);
return;
@@ -276,10 +276,10 @@ public final class ClusterServerConfigManager {
private synchronized void applyConfig(ServerTransportConfig config) {
if (!isValidTransportConfig(config)) {
RecordLog.warn(
"[ClusterServerConfigManager] Invalid cluster server transport config, ignoring: " + config);
"[ClusterServerConfigManager] Invalid cluster server transport config, ignoring: {}", config);
return;
}
RecordLog.info("[ClusterServerConfigManager] Updating new server transport config: " + config);
RecordLog.info("[ClusterServerConfigManager] Updating new server transport config: {}", config);
if (config.getIdleSeconds() != idleSeconds) {
idleSeconds = config.getIdleSeconds();
}
@@ -315,10 +315,10 @@ public final class ClusterServerConfigManager {
private synchronized void applyGlobalFlowConfig(ServerFlowConfig config) {
if (!isValidFlowConfig(config)) {
RecordLog.warn(
"[ClusterServerConfigManager] Invalid cluster server global flow config, ignoring: " + config);
"[ClusterServerConfigManager] Invalid cluster server global flow config, ignoring: {}", config);
return;
}
RecordLog.info("[ClusterServerConfigManager] Updating new server global flow config: " + config);
RecordLog.info("[ClusterServerConfigManager] Updating new server global flow config: {}", config);
if (config.getExceedCount() != exceedCount) {
exceedCount = config.getExceedCount();
}


+ 2
- 4
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/connection/ScanIdleConnectionTask.java Voir le fichier

@@ -31,10 +31,8 @@ public class ScanIdleConnectionTask implements Runnable {
List<Connection> connections = connectionPool.listAllConnection();
for (Connection conn : connections) {
if ((now - conn.getLastReadTime()) > idleTimeMillis) {
RecordLog.info(
String.format("[ScanIdleConnectionTask] The connection <%s:%d> has been idle for <%d>s. "
+ "It will be closed now.", conn.getRemoteIP(), conn.getRemotePort(), idleSeconds)
);
RecordLog.info("[ScanIdleConnectionTask] The connection <{}:{}> has been idle for <{}>s. It will be closed now.",
conn.getRemoteIP(), conn.getRemotePort(), idleSeconds);
conn.close();
}
}


+ 1
- 1
sentinel-cluster/sentinel-cluster-server-envoy-rls/src/main/java/com/alibaba/csp/sentinel/cluster/server/envoy/rls/rule/EnvoyRlsRuleManager.java Voir le fichier

@@ -91,7 +91,7 @@ public final class EnvoyRlsRuleManager {

RULE_MAP.clear();
RULE_MAP.putAll(ruleMap);
RecordLog.info("[EnvoyRlsRuleManager] Envoy RLS rules loaded: " + flowRules);
RecordLog.info("[EnvoyRlsRuleManager] Envoy RLS rules loaded: {}", flowRules);

// Use the "default" namespace.
ClusterFlowRuleManager.loadRules(ServerConstants.DEFAULT_NAMESPACE, flowRules);


+ 2
- 2
sentinel-core/src/main/java/com/alibaba/csp/sentinel/cluster/client/TokenClientProvider.java Voir le fichier

@@ -44,8 +44,8 @@ public final class TokenClientProvider {
"[TokenClientProvider] No existing cluster token client, cluster client mode will not be activated");
} else {
client = resolvedClient;
RecordLog.info(
"[TokenClientProvider] Cluster token client resolved: " + client.getClass().getCanonicalName());
RecordLog.info("[TokenClientProvider] Cluster token client resolved: {}",
client.getClass().getCanonicalName());
}
}



+ 2
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/cluster/server/EmbeddedClusterTokenServerProvider.java Voir le fichier

@@ -36,7 +36,8 @@ public final class EmbeddedClusterTokenServerProvider {
RecordLog.warn("[EmbeddedClusterTokenServerProvider] No existing cluster token server, cluster server mode will not be activated");
} else {
server = s;
RecordLog.info("[EmbeddedClusterTokenServerProvider] Cluster token server resolved: " + server.getClass().getCanonicalName());
RecordLog.info("[EmbeddedClusterTokenServerProvider] Cluster token server resolved: {}",
server.getClass().getCanonicalName());
}
}



+ 1
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/config/SentinelConfig.java Voir le fichier

@@ -68,7 +68,7 @@ public final class SentinelConfig {
loadProps();
resolveAppName();
resolveAppType();
RecordLog.info("[SentinelConfig] Application type resolved: " + appType);
RecordLog.info("[SentinelConfig] Application type resolved: {}", appType);
} catch (Throwable ex) {
RecordLog.warn("[SentinelConfig] Failed to initialize", ex);
ex.printStackTrace();


+ 1
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/config/SentinelConfigLoader.java Voir le fichier

@@ -62,7 +62,7 @@ public final class SentinelConfigLoader {

Properties p = ConfigUtil.loadProperties(fileName);
if (p != null && !p.isEmpty()) {
RecordLog.info("[SentinelConfigLoader] Loading Sentinel config from " + fileName);
RecordLog.info("[SentinelConfigLoader] Loading Sentinel config from {}", fileName);
properties.putAll(p);
}



+ 3
- 3
sentinel-core/src/main/java/com/alibaba/csp/sentinel/init/InitExecutor.java Voir le fichier

@@ -46,13 +46,13 @@ public final class InitExecutor {
ServiceLoader<InitFunc> loader = ServiceLoaderUtil.getServiceLoader(InitFunc.class);
List<OrderWrapper> initList = new ArrayList<OrderWrapper>();
for (InitFunc initFunc : loader) {
RecordLog.info("[InitExecutor] Found init func: " + initFunc.getClass().getCanonicalName());
RecordLog.info("[InitExecutor] Found init func: {}", initFunc.getClass().getCanonicalName());
insertSorted(initList, initFunc);
}
for (OrderWrapper w : initList) {
w.func.init();
RecordLog.info(String.format("[InitExecutor] Executing %s with order %d",
w.func.getClass().getCanonicalName(), w.order));
RecordLog.info("[InitExecutor] Executing {} with order {}",
w.func.getClass().getCanonicalName(), w.order);
}
} catch (Exception ex) {
RecordLog.warn("[InitExecutor] WARN: Initialization failed", ex);


+ 1
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/metric/extension/MetricExtensionProvider.java Voir le fichier

@@ -41,7 +41,7 @@ public class MetricExtensionProvider {
RecordLog.info("[MetricExtensionProvider] No existing MetricExtension found");
} else {
metricExtensions.addAll(extensions);
RecordLog.info("[MetricExtensionProvider] MetricExtension resolved, size=" + extensions.size());
RecordLog.info("[MetricExtensionProvider] MetricExtension resolved, size={}", extensions.size());
}
}



+ 1
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/IntervalProperty.java Voir le fichier

@@ -62,7 +62,7 @@ public class IntervalProperty {
INTERVAL = newInterval;
ClusterBuilderSlot.resetClusterNodes();
}
RecordLog.info("[IntervalProperty] INTERVAL updated to: " + INTERVAL);
RecordLog.info("[IntervalProperty] INTERVAL updated to: {}", INTERVAL);
}

}

+ 3
- 3
sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/OccupyTimeoutProperty.java Voir le fichier

@@ -67,13 +67,13 @@ public class OccupyTimeoutProperty {
return;
}
if (newInterval > IntervalProperty.INTERVAL) {
RecordLog.warn("[OccupyTimeoutProperty] Illegal timeout value will be ignored: " + occupyTimeout
+ ", should <= " + IntervalProperty.INTERVAL);
RecordLog.warn("[OccupyTimeoutProperty] Illegal timeout value will be ignored: {}, should <= {}",
occupyTimeout, IntervalProperty.INTERVAL);
return;
}
if (newInterval != occupyTimeout) {
occupyTimeout = newInterval;
}
RecordLog.info("[OccupyTimeoutProperty] occupyTimeout updated to: " + occupyTimeout);
RecordLog.info("[OccupyTimeoutProperty] occupyTimeout updated to: {}", occupyTimeout);
}
}

+ 1
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/SampleCountProperty.java Voir le fichier

@@ -60,6 +60,6 @@ public class SampleCountProperty {
SAMPLE_COUNT = newSampleCount;
ClusterBuilderSlot.resetClusterNodes();
}
RecordLog.info("SAMPLE_COUNT updated to: " + SAMPLE_COUNT);
RecordLog.info("SAMPLE_COUNT updated to: {}", SAMPLE_COUNT);
}
}

+ 6
- 7
sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricWriter.java Voir le fichier

@@ -92,9 +92,8 @@ public class MetricWriter {
if (singleFileSize <= 0 || totalFileCount <= 0) {
throw new IllegalArgumentException();
}
RecordLog.info(
"[MetricWriter] Creating new MetricWriter, singleFileSize=" + singleFileSize + ", totalFileCount="
+ totalFileCount);
RecordLog.info("[MetricWriter] Creating new MetricWriter, singleFileSize={}, totalFileCount={}",
singleFileSize, totalFileCount);
this.baseDir = METRIC_BASE_DIR;
File dir = new File(baseDir);
if (!dir.exists()) {
@@ -328,9 +327,9 @@ public class MetricWriter {
String fileName = list.get(i);
String indexFile = formIndexFileName(fileName);
new File(fileName).delete();
RecordLog.info("[MetricWriter] Removing metric file: " + fileName);
RecordLog.info("[MetricWriter] Removing metric file: {}", fileName);
new File(indexFile).delete();
RecordLog.info("[MetricWriter] Removing metric index file: " + indexFile);
RecordLog.info("[MetricWriter] Removing metric index file: {}", indexFile);
}
}

@@ -348,8 +347,8 @@ public class MetricWriter {
String idxFile = formIndexFileName(fileName);
curMetricIndexFile = new File(idxFile);
outIndex = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(idxFile, append)));
RecordLog.info("[MetricWriter] New metric file created: " + fileName);
RecordLog.info("[MetricWriter] New metric index file created: " + idxFile);
RecordLog.info("[MetricWriter] New metric file created: {}", fileName);
RecordLog.info("[MetricWriter] New metric index file created: {}", idxFile);
}

private boolean validSize() throws Exception {


+ 1
- 1
sentinel-core/src/main/java/com/alibaba/csp/sentinel/property/DynamicSentinelProperty.java Voir le fichier

@@ -50,7 +50,7 @@ public class DynamicSentinelProperty<T> implements SentinelProperty<T> {
if (isEqual(value, newValue)) {
return false;
}
RecordLog.info("[DynamicSentinelProperty] Config will be updated to: " + newValue);
RecordLog.info("[DynamicSentinelProperty] Config will be updated to: {}", newValue);

value = newValue;
for (PropertyListener<T> listener : listeners) {


+ 2
- 2
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slotchain/SlotChainProvider.java Voir le fichier

@@ -48,8 +48,8 @@ public final class SlotChainProvider {
RecordLog.warn("[SlotChainProvider] Wrong state when resolving slot chain builder, using default");
slotChainBuilder = new DefaultSlotChainBuilder();
} else {
RecordLog.info("[SlotChainProvider] Global slot chain builder resolved: "
+ slotChainBuilder.getClass().getCanonicalName());
RecordLog.info("[SlotChainProvider] Global slot chain builder resolved: {}",
slotChainBuilder.getClass().getCanonicalName());
}
return slotChainBuilder.build();
}


+ 4
- 4
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/authority/AuthorityRuleManager.java Voir le fichier

@@ -99,7 +99,7 @@ public final class AuthorityRuleManager {
if (rules != null) {
authorityRules.putAll(rules);
}
RecordLog.info("[AuthorityRuleManager] Authority rules received: " + authorityRules);
RecordLog.info("[AuthorityRuleManager] Authority rules received: {}", authorityRules);
}

private Map<String, Set<AuthorityRule>> loadAuthorityConf(List<AuthorityRule> list) {
@@ -111,7 +111,7 @@ public final class AuthorityRuleManager {

for (AuthorityRule rule : list) {
if (!isValidRule(rule)) {
RecordLog.warn("[AuthorityRuleManager] Ignoring invalid authority rule when loading new rules: " + rule);
RecordLog.warn("[AuthorityRuleManager] Ignoring invalid authority rule when loading new rules: {}", rule);
continue;
}

@@ -128,7 +128,7 @@ public final class AuthorityRuleManager {
newRuleMap.put(identity, ruleSet);
} else {
// One resource should only have at most one authority rule, so just ignore redundant rules.
RecordLog.warn("[AuthorityRuleManager] Ignoring redundant rule: " + rule.toString());
RecordLog.warn("[AuthorityRuleManager] Ignoring redundant rule: {}", rule.toString());
}
}

@@ -143,7 +143,7 @@ public final class AuthorityRuleManager {
if (rules != null) {
authorityRules.putAll(rules);
}
RecordLog.info("[AuthorityRuleManager] Load authority rules: " + authorityRules);
RecordLog.info("[AuthorityRuleManager] Load authority rules: {}", authorityRules);
}
}



+ 4
- 4
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRuleManager.java Voir le fichier

@@ -224,13 +224,13 @@ public final class DegradeRuleManager {
@Override
public void configUpdate(List<DegradeRule> conf) {
reloadFrom(conf);
RecordLog.info("[DegradeRuleManager] Degrade rules has been updated to: " + ruleMap);
RecordLog.info("[DegradeRuleManager] Degrade rules has been updated to: {}", ruleMap);
}

@Override
public void configLoad(List<DegradeRule> conf) {
reloadFrom(conf);
RecordLog.info("[DegradeRuleManager] Degrade rules loaded: " + ruleMap);
RecordLog.info("[DegradeRuleManager] Degrade rules loaded: {}", ruleMap);
}

private Map<String, List<CircuitBreaker>> buildCircuitBreakers(List<DegradeRule> list) {
@@ -240,7 +240,7 @@ public final class DegradeRuleManager {
}
for (DegradeRule rule : list) {
if (!isValidRule(rule)) {
RecordLog.warn("[DegradeRuleManager] Ignoring invalid rule when loading new rules: " + rule);
RecordLog.warn("[DegradeRuleManager] Ignoring invalid rule when loading new rules: {}", rule);
continue;
}

@@ -249,7 +249,7 @@ public final class DegradeRuleManager {
}
CircuitBreaker cb = getExistingSameCbOrNew(rule);
if (cb == null) {
RecordLog.warn("[DegradeRuleManager] Unknown circuit breaking strategy, ignoring: " + rule);
RecordLog.warn("[DegradeRuleManager] Unknown circuit breaking strategy, ignoring: {}", rule);
continue;
}



+ 2
- 2
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowRuleManager.java Voir le fichier

@@ -133,7 +133,7 @@ public class FlowRuleManager {
flowRules.clear();
flowRules.putAll(rules);
}
RecordLog.info("[FlowRuleManager] Flow rules received: " + flowRules);
RecordLog.info("[FlowRuleManager] Flow rules received: {}", flowRules);
}

@Override
@@ -143,7 +143,7 @@ public class FlowRuleManager {
flowRules.clear();
flowRules.putAll(rules);
}
RecordLog.info("[FlowRuleManager] Flow rules loaded: " + flowRules);
RecordLog.info("[FlowRuleManager] Flow rules loaded: {}", flowRules);
}
}



+ 2
- 2
sentinel-extension/sentinel-datasource-apollo/src/main/java/com/alibaba/csp/sentinel/datasource/apollo/ApolloDataSource.java Voir le fichier

@@ -53,7 +53,7 @@ public class ApolloDataSource<T> extends AbstractDataSource<String, T> {

initialize();

RecordLog.info(String.format("Initialized rule for namespace: %s, rule key: %s", namespaceName, ruleKey));
RecordLog.info("Initialized rule for namespace: {}, rule key: {}", namespaceName, ruleKey);
}

private void initialize() {
@@ -80,7 +80,7 @@ public class ApolloDataSource<T> extends AbstractDataSource<String, T> {
ConfigChange change = changeEvent.getChange(ruleKey);
//change is never null because the listener will only notify for this key
if (change != null) {
RecordLog.info("[ApolloDataSource] Received config changes: " + change.toString());
RecordLog.info("[ApolloDataSource] Received config changes: {}", change);
}
loadAndUpdateRules();
}


+ 1
- 1
sentinel-extension/sentinel-datasource-extension/src/main/java/com/alibaba/csp/sentinel/datasource/FileWritableDataSource.java Voir le fichier

@@ -73,7 +73,7 @@ public class FileWritableDataSource<T> implements WritableDataSource<T> {
outputStream = new FileOutputStream(file);
byte[] bytesArray = convertResult.getBytes(charset);

RecordLog.info(String.format("[FileWritableDataSource] Writing to file %s: %s", file.toString(), convertResult));
RecordLog.info("[FileWritableDataSource] Writing to file {}: {}", file, convertResult);
outputStream.write(bytesArray);
outputStream.flush();
} finally {


+ 2
- 2
sentinel-extension/sentinel-datasource-nacos/src/main/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java Voir le fichier

@@ -99,8 +99,8 @@ public class NacosDataSource<T> extends AbstractDataSource<String, T> {

@Override
public void receiveConfigInfo(final String configInfo) {
RecordLog.info(String.format("[NacosDataSource] New property value received for (properties: %s) (dataId: %s, groupId: %s): %s",
properties, dataId, groupId, configInfo));
RecordLog.info("[NacosDataSource] New property value received for (properties: {}) (dataId: {}, groupId: {}): {}",
properties, dataId, groupId, configInfo);
T newValue = NacosDataSource.this.parser.convert(configInfo);
// Update the new value to the property.
getProperty().updateValue(newValue);


+ 1
- 1
sentinel-extension/sentinel-datasource-redis/src/main/java/com/alibaba/csp/sentinel/datasource/redis/RedisDataSource.java Voir le fichier

@@ -172,7 +172,7 @@ public class RedisDataSource<T> extends AbstractDataSource<String, T> {

@Override
public void message(String channel, String message) {
RecordLog.info(String.format("[RedisDataSource] New property value received for channel %s: %s", channel, message));
RecordLog.info("[RedisDataSource] New property value received for channel {}: {}", channel, message);
getProperty().updateValue(parser.convert(message));
}
}


+ 3
- 4
sentinel-extension/sentinel-datasource-spring-cloud-config/src/main/java/com/alibaba/csp/sentinel/datasource/spring/cloud/config/SentinelRuleLocator.java Voir le fichier

@@ -147,11 +147,10 @@ public class SentinelRuleLocator implements PropertySourceLocator {

private void log(Environment result) {

RecordLog.info(String.format(
"Located environment: name=%s, profiles=%s, label=%s, version=%s, state=%s",
RecordLog.info("Located environment: name={}, profiles={}, label={}, version={}, state={}",
result.getName(),
result.getProfiles() == null ? "" : Arrays.asList(result.getProfiles()),
result.getLabel(), result.getVersion(), result.getState()));
result.getLabel(), result.getVersion(), result.getState());

List<PropertySource> propertySourceList = result.getPropertySources();
if (propertySourceList != null) {
@@ -194,7 +193,7 @@ public class SentinelRuleLocator implements PropertySourceLocator {
String username = credentials.getUsername();
String password = credentials.getPassword();

RecordLog.info("[SentinelRuleLocator] Fetching config from server at: " + uri);
RecordLog.info("[SentinelRuleLocator] Fetching config from server at: {}", uri);

try {
HttpHeaders headers = new HttpHeaders();


+ 2
- 2
sentinel-extension/sentinel-datasource-zookeeper/src/main/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSource.java Voir le fichier

@@ -110,8 +110,8 @@ public class ZookeeperDataSource<T> extends AbstractDataSource<String, T> {

try {
T newValue = loadConfig();
RecordLog.info(String.format("[ZookeeperDataSource] New property value received for (%s, %s): %s",
serverAddr, path, newValue));
RecordLog.info("[ZookeeperDataSource] New property value received for ({}, {}): {}",
serverAddr, path, newValue);
// Update the new value to the property.
getProperty().updateValue(newValue);
} catch (Exception ex) {


+ 1
- 1
sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/command/handler/ModifyParamFlowRulesCommandHandler.java Voir le fichier

@@ -51,7 +51,7 @@ public class ModifyParamFlowRulesCommandHandler implements CommandHandler<String
return CommandResponse.ofFailure(e, "decode rule data error");
}

RecordLog.info(String.format("[API Server] Receiving rule change (type:parameter flow rule): %s", data));
RecordLog.info("[API Server] Receiving rule change (type:parameter flow rule): {}", data);

String result = SUCCESS_MSG;
List<ParamFlowRule> flowRules = JSONArray.parseArray(data, ParamFlowRule.class);


+ 2
- 2
sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowRuleManager.java Voir le fichier

@@ -105,7 +105,7 @@ public final class ParamFlowRuleManager {
PARAM_FLOW_RULES.clear();
PARAM_FLOW_RULES.putAll(rules);
}
RecordLog.info("[ParamFlowRuleManager] Parameter flow rules received: " + PARAM_FLOW_RULES);
RecordLog.info("[ParamFlowRuleManager] Parameter flow rules received: {}", PARAM_FLOW_RULES);
}

@Override
@@ -115,7 +115,7 @@ public final class ParamFlowRuleManager {
PARAM_FLOW_RULES.clear();
PARAM_FLOW_RULES.putAll(rules);
}
RecordLog.info("[ParamFlowRuleManager] Parameter flow rules received: " + PARAM_FLOW_RULES);
RecordLog.info("[ParamFlowRuleManager] Parameter flow rules received: {}", PARAM_FLOW_RULES);
}

private Map<String, List<ParamFlowRule>> aggregateAndPrepareParamRules(List<ParamFlowRule> list) {


+ 2
- 2
sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParameterMetricStorage.java Voir le fichier

@@ -54,7 +54,7 @@ public final class ParameterMetricStorage {
if ((metric = metricsMap.get(resourceName)) == null) {
metric = new ParameterMetric();
metricsMap.put(resourceWrapper.getName(), metric);
RecordLog.info("[ParameterMetricStorage] Creating parameter metric for: " + resourceWrapper.getName());
RecordLog.info("[ParameterMetricStorage] Creating parameter metric for: {}", resourceWrapper.getName());
}
}
}
@@ -80,7 +80,7 @@ public final class ParameterMetricStorage {
return;
}
metricsMap.remove(resourceName);
RecordLog.info("[ParameterMetricStorage] Clearing parameter metric for: " + resourceName);
RecordLog.info("[ParameterMetricStorage] Clearing parameter metric for: {}", resourceName);
}

static Map<String, ParameterMetric> getMetricsMap() {


+ 1
- 1
sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/CommandCenterProvider.java Voir le fichier

@@ -40,7 +40,7 @@ public final class CommandCenterProvider {
RecordLog.warn("[CommandCenterProvider] WARN: No existing CommandCenter found");
} else {
commandCenter = resolveCommandCenter;
RecordLog.info("[CommandCenterProvider] CommandCenter resolved: " + resolveCommandCenter.getClass()
RecordLog.info("[CommandCenterProvider] CommandCenter resolved: {}", resolveCommandCenter.getClass()
.getCanonicalName());
}
}


+ 1
- 1
sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/cluster/ModifyClusterModeCommandHandler.java Voir le fichier

@@ -41,7 +41,7 @@ public class ModifyClusterModeCommandHandler implements CommandHandler<String> {
if (mode == ClusterStateManager.CLUSTER_SERVER && !isClusterServerSpiAvailable()) {
return CommandResponse.ofFailure(new IllegalStateException("token server mode not available: no SPI found"));
}
RecordLog.info("[ModifyClusterModeCommandHandler] Modifying cluster mode to: " + mode);
RecordLog.info("[ModifyClusterModeCommandHandler] Modifying cluster mode to: {}", mode);

ClusterStateManager.applyState(mode);
return CommandResponse.ofSuccess("success");


+ 1
- 1
sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/heartbeat/HeartbeatSenderProvider.java Voir le fichier

@@ -37,7 +37,7 @@ public final class HeartbeatSenderProvider {
RecordLog.warn("[HeartbeatSenderProvider] WARN: No existing HeartbeatSender found");
} else {
heartbeatSender = resolved;
RecordLog.info("[HeartbeatSenderProvider] HeartbeatSender activated: " + resolved.getClass()
RecordLog.info("[HeartbeatSenderProvider] HeartbeatSender activated: {}", resolved.getClass()
.getCanonicalName());
}
}


+ 1
- 2
sentinel-transport/sentinel-transport-netty-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/HttpHeartbeatSender.java Voir le fichier

@@ -67,8 +67,7 @@ public class HttpHeartbeatSender implements HeartbeatSender {
} else {
consoleHost = dashboardList.get(0).r1;
consolePort = dashboardList.get(0).r2;
RecordLog.info(
"[NettyHttpHeartbeatSender] Dashboard address parsed: <" + consoleHost + ':' + consolePort + ">");
RecordLog.info("[NettyHttpHeartbeatSender] Dashboard address parsed: <{}:{}>", consoleHost, consolePort);
}
}



+ 1
- 1
sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/SimpleHttpHeartbeatSender.java Voir le fichier

@@ -52,7 +52,7 @@ public class SimpleHttpHeartbeatSender implements HeartbeatSender {
if (newAddrs.isEmpty()) {
RecordLog.warn("[SimpleHttpHeartbeatSender] Dashboard server address not configured or not available");
} else {
RecordLog.info("[SimpleHttpHeartbeatSender] Default console address list retrieved: " + newAddrs);
RecordLog.info("[SimpleHttpHeartbeatSender] Default console address list retrieved: {}", newAddrs);
}
this.addressList = newAddrs;
}


Chargement…
Annuler
Enregistrer