Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private synchronized void applyGatewayRuleInternal(Set<GatewayFlowRule> conf) {

for (GatewayFlowRule rule : conf) {
if (!isValidRule(rule)) {
RecordLog.warn("[GatewayRuleManager] Ignoring invalid rule when loading new rules: " + rule);
RecordLog.warn("[GatewayRuleManager] Ignoring invalid rule when loading new rules: {}", rule);
continue;
}
String resourceName = rule.getResource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static int getBlockPageHttpStatus() {
}
return s;
} catch (Exception e) {
RecordLog.warn("[WebServletConfig] Invalid block HTTP status (" + value + "), using default 429");
RecordLog.warn("[WebServletConfig] Invalid block HTTP status ({}) using default 429", value);
setBlockPageHttpStatus(HTTP_STATUS_TOO_MANY_REQUESTS);
}
return HTTP_STATUS_TOO_MANY_REQUESTS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ public List<Object> resolveValidParams(Collection<Object> params) {
for (Object param : params) {
int s = calculateParamTransportSize(param);
if (s <= 0) {
RecordLog.warn("[ParamFlowRequestDataWriter] WARN: Non-primitive type detected in params of "
+ "cluster parameter flow control, which is not supported: " + param);
RecordLog.warn("[ParamFlowRequestDataWriter] WARN: Non-primitive type detected in params of cluster parameter flow control, which is not supported: {}", param);
continue;
}
if (size + s > maxParamByteSize) {
RecordLog.warn("[ParamFlowRequestDataWriter] WARN: params size is too big." +
" the configure value is : " + maxParamByteSize + ", the params size is: " + params.size());
" the configure value is : {}, the params size is: {}", maxParamByteSize, params.size());
break;
}
size += s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void configUpdate(ClusterClientAssignConfig config) {
private synchronized void applyConfig(ClusterClientAssignConfig config) {
if (!isValidAssignConfig(config)) {
RecordLog.warn(
"[ClusterClientConfigManager] Invalid cluster client assign config, ignoring: " + config);
"[ClusterClientConfigManager] Invalid cluster client assign config, ignoring: {}", config);
return;
}
if (serverPort == config.getServerPort() && config.getServerHost().equals(serverHost)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Integer getMaxParamByteSize() {
try {
return maxParamByteSize == null ? null : Integer.valueOf(maxParamByteSize);
} catch (Exception ex) {
RecordLog.warn("[ClusterClientStartUpConfig] Failed to parse maxParamByteSize: " + maxParamByteSize);
RecordLog.warn("[ClusterClientStartUpConfig] Failed to parse maxParamByteSize: {}", maxParamByteSize);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public static TokenService getService() {
private static void resolveTokenServiceSpi() {
service = SpiLoader.of(TokenService.class).loadFirstInstanceOrDefault();
if (service != null) {
RecordLog.info("[TokenServiceProvider] Global token service resolved: "
+ service.getClass().getCanonicalName());
RecordLog.info("[TokenServiceProvider] Global token service resolved: {}", service.getClass().getCanonicalName());
} else {
RecordLog.warn("[TokenServiceProvider] Unable to resolve TokenService: no SPI found");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
// Pick request processor for request type.
RequestProcessor<?, ?> processor = RequestProcessorProvider.getProcessor(request.getType());
if (processor == null) {
RecordLog.warn("[TokenServerHandler] No processor for request type: " + request.getType());
RecordLog.warn("[TokenServerHandler] No processor for request type: {}", request.getType());
writeBadResponse(ctx, request);
} else {
ClusterResponse<?> response = processor.processRequest(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ private static int resolvePort() {
try {
int port = Integer.parseInt(portStr);
if (port <= 0 || port > 65535) {
RecordLog.warn("[SentinelEnvoyRlsServer] Invalid port <" + portStr + ">, using default" + defaultPort);
RecordLog.warn("[SentinelEnvoyRlsServer] Invalid port <{}>, using default {}", portStr, defaultPort);
return defaultPort;
}
return port;
} catch (Exception ex) {
RecordLog.warn("[SentinelEnvoyRlsServer] Failed to resolve port, using default " + defaultPort);
RecordLog.warn("[SentinelEnvoyRlsServer] Failed to resolve port, using default {}", defaultPort);
System.err.println("[SentinelEnvoyRlsServer] Failed to resolve port, using default " + defaultPort);
return defaultPort;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ Map<String, EnvoyRlsRule> generateRuleMap(List<EnvoyRlsRule> conf) {
Map<String, EnvoyRlsRule> map = new HashMap<>(conf.size());
for (EnvoyRlsRule rule : conf) {
if (!isValidRule(rule)) {
RecordLog.warn("[EnvoyRlsRuleManager] Ignoring invalid rule when loading new RLS rules: " + rule);
RecordLog.warn("[EnvoyRlsRuleManager] Ignoring invalid rule when loading new RLS rules: {}", rule);
continue;
}
if (map.containsKey(rule.getDomain())) {
RecordLog.warn("[EnvoyRlsRuleManager] Ignoring duplicate RLS rule for specific domain: " + rule);
RecordLog.warn("[EnvoyRlsRuleManager] Ignoring duplicate RLS rule for specific domain: {}", rule);
continue;
}
map.put(rule.getDomain(), rule);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void initAsyncContext() {
.setCurEntry(this);
} else {
RecordLog.warn(
"[AsyncEntry] Duplicate initialize of async context for entry: " + resourceWrapper.getName());
"[AsyncEntry] Duplicate initialize of async context for entry: {}", resourceWrapper.getName());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ public static int coldFactor() {
// check the cold factor larger than 1
if (coldFactor <= 1) {
coldFactor = DEFAULT_COLD_FACTOR;
RecordLog.warn("cold factor=" + coldFactor + ", should be larger than 1, use default value: "
+ DEFAULT_COLD_FACTOR);
RecordLog.warn("cold factor={}, should be larger than 1, use default value: {}"
, coldFactor, DEFAULT_COLD_FACTOR);
}
return coldFactor;
} catch (Throwable throwable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ private static void setNullContext() {
contextHolder.set(NULL_CONTEXT);
// Don't need to be thread-safe.
if (shouldWarn) {
RecordLog.warn("[SentinelStatusChecker] WARN: Amount of context exceeds the threshold "
+ Constants.MAX_CONTEXT_NAME_SIZE + ". Entries in new contexts will NOT take effect!");
RecordLog.warn("[SentinelStatusChecker] WARN: Amount of context exceeds the threshold {}. Entries in new contexts will NOT take effect!", Constants.MAX_CONTEXT_NAME_SIZE);
shouldWarn = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static int getOccupyTimeout() {
*/
public static void updateTimeout(int newInterval) {
if (newInterval < 0) {
RecordLog.warn("[OccupyTimeoutProperty] Illegal timeout value will be ignored: " + occupyTimeout);
RecordLog.warn("[OccupyTimeoutProperty] Illegal timeout value will be ignored: {}", occupyTimeout);
return;
}
if (newInterval > IntervalProperty.INTERVAL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ProcessorSlotChain build() {
List<ProcessorSlot> sortedSlotList = SpiLoader.of(ProcessorSlot.class).loadInstanceListSorted();
for (ProcessorSlot slot : sortedSlotList) {
if (!(slot instanceof AbstractLinkedProcessorSlot)) {
RecordLog.warn("The ProcessorSlot(" + slot.getClass().getCanonicalName() + ") is not an instance of AbstractLinkedProcessorSlot, can't be added into ProcessorSlotChain");
RecordLog.warn("The ProcessorSlot({}) is not an instance of AbstractLinkedProcessorSlot, can't be added into ProcessorSlotChain", slot.getClass().getCanonicalName());
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static <K> Map<K, List<FlowRule>> buildFlowRuleMap(List<FlowRule> list, F

for (FlowRule rule : list) {
if (!isValidRule(rule)) {
RecordLog.warn("[FlowRuleManager] Ignoring invalid flow rule when loading new flow rules: " + rule);
RecordLog.warn("[FlowRuleManager] Ignoring invalid flow rule when loading new flow rules: {}", rule);
continue;
}
if (filter != null && !filter.test(rule)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public void load() {
}

if (urls == null || !urls.hasMoreElements()) {
RecordLog.warn("No SPI configuration file, filename=" + fullFileName + ", classloader=" + classLoader);
RecordLog.warn("No SPI configuration file, filename={}, classloader={}", fullFileName, classLoader);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void testLogException() {
public void testLogRolling() {
int count = 1000;
while (--count > 0) {
RecordLog.info("Count " + count);
RecordLog.info("Count {}", count);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ProcessorSlotChain build() {
sortedSlotList.removeIf(o -> DegradeSlot.class.equals(o.getClass()));
for (ProcessorSlot slot : sortedSlotList) {
if (!(slot instanceof AbstractLinkedProcessorSlot)) {
RecordLog.warn("The ProcessorSlot(" + slot.getClass().getCanonicalName() + ") is not an instance of AbstractLinkedProcessorSlot, can't be added into ProcessorSlotChain");
RecordLog.warn("The ProcessorSlot({}) is not an instance of AbstractLinkedProcessorSlot, can't be added into ProcessorSlotChain", slot.getClass().getCanonicalName());
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public org.springframework.core.env.PropertySource<?> locate(
"Could not locate PropertySource and the fail fast property is set, failing",
error);
}
RecordLog.warn("Could not locate PropertySource: " + (errorBody == null
RecordLog.warn("Could not locate PropertySource: {}", (errorBody == null
? error == null ? "label not found" : error.getMessage()
: errorBody));
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static <K> Map<K, List<ParamFlowRule>> buildParamRuleMap(List<ParamFlowRu

for (ParamFlowRule rule : list) {
if (!ParamFlowRuleUtil.isValidRule(rule)) {
RecordLog.warn("[ParamFlowRuleManager] Ignoring invalid rule when loading new rules: " + rule);
RecordLog.warn("[ParamFlowRuleManager] Ignoring invalid rule when loading new rules: {}", rule);
continue;
}
if (filter != null && !filter.test(rule)) {
Expand Down Expand Up @@ -200,7 +200,7 @@ static Map<Object, Integer> parseHotItems(List<ParamFlowItem> items) {
continue;
}
if (item.getCount() == null || item.getCount() < 0 || value == null) {
RecordLog.warn("[ParamFlowRuleUtil] Ignoring invalid exclusion parameter item: " + item);
RecordLog.warn("[ParamFlowRuleUtil] Ignoring invalid exclusion parameter item: {}", item);
continue;
}
itemMap.put(value, item.getCount());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static Long getHeartbeatIntervalMs() {
try {
return interval == null ? null : Long.parseLong(interval);
} catch (Exception ex) {
RecordLog.warn("[TransportConfig] Failed to parse heartbeat interval: " + interval);
RecordLog.warn("[TransportConfig] Failed to parse heartbeat interval:{}", interval);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void init() throws Exception {

commandCenter.beforeStart();
commandCenter.start();
RecordLog.info("[CommandCenterInit] Starting command center: "
+ commandCenter.getClass().getCanonicalName());
RecordLog.info("[CommandCenterInit] Starting command center: {}", commandCenter.getClass().getCanonicalName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ private void setIntervalIfNotExists(long interval) {
long retrieveInterval(/*@NonNull*/ HeartbeatSender sender) {
Long intervalInConfig = TransportConfig.getHeartbeatIntervalMs();
if (isValidHeartbeatInterval(intervalInConfig)) {
RecordLog.info("[HeartbeatSenderInitFunc] Using heartbeat interval "
+ "in Sentinel config property: " + intervalInConfig);
RecordLog.info("[HeartbeatSenderInitFunc] Using heartbeat interval " +
"in Sentinel config property:{}", intervalInConfig);
return intervalInConfig;
} else {
long senderInterval = sender.intervalMs();
RecordLog.info("[HeartbeatSenderInit] Heartbeat interval not configured in "
+ "config property or invalid, using sender default: " + senderInterval);
RecordLog.info("[HeartbeatSenderInit] Heartbeat interval not configured in " +
"config property or invalid using sender default:{}",senderInterval);
return senderInterval;
}
}
Expand All @@ -94,7 +94,6 @@ public void run() {
}
}
}, 5000, interval, TimeUnit.MILLISECONDS);
RecordLog.info("[HeartbeatSenderInit] HeartbeatSender started: "
+ sender.getClass().getCanonicalName());
RecordLog.info("[HeartbeatSenderInit] HeartbeatSender started: {}", sender.getClass().getCanonicalName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public boolean sendHeartbeat() throws Exception {
if (response.getStatusCode() == OK_STATUS) {
return true;
} else if (clientErrorCode(response.getStatusCode()) || serverErrorCode(response.getStatusCode())) {
RecordLog.warn("[SimpleHttpHeartbeatSender] Failed to send heartbeat to " + addrInfo
+ ", http status code: " + response.getStatusCode());
RecordLog.warn("[SimpleHttpHeartbeatSender] Failed to send heartbeat to {} " +
", http status code:{}", addrInfo, response.getStatusCode());
}
} catch (Exception e) {
RecordLog.warn("[SimpleHttpHeartbeatSender] Failed to send heartbeat to " + addrInfo, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public boolean sendHeartbeat() throws Exception {
if (statusCode == OK_STATUS) {
return true;
} else if (clientErrorCode(statusCode) || serverErrorCode(statusCode)) {
RecordLog.warn("[HttpHeartbeatSender] Failed to send heartbeat to "
+ consoleHost + ":" + consolePort + ", http status code: " + statusCode);
RecordLog.warn("[HttpHeartbeatSender] Failed to send heartbeat to " +
"{}:{} http status code:{}", consoleHost, consolePort, statusCode);
}

return false;
Expand Down