Skip to content

Commit 522bb82

Browse files
committed
update logging as suggested
1 parent 5074a21 commit 522bb82

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/main/java/com/cloud/api/ApiServer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import java.util.concurrent.LinkedBlockingQueue;
4747
import java.util.concurrent.ThreadPoolExecutor;
4848
import java.util.concurrent.TimeUnit;
49+
import java.util.function.Supplier;
4950
import java.util.regex.Matcher;
5051
import java.util.regex.Pattern;
5152
import java.util.stream.Collectors;
@@ -626,7 +627,7 @@ public String handleRequest(final Map params, final String responseType, final S
626627
for (final Object key : params.keySet()) {
627628
final String keyStr = (String)key;
628629
final String[] value = (String[])params.get(key);
629-
logger.trace(" key: {}, value: {}", keyStr, (value == null) ? "'null'" : value[0]);
630+
logger.trace(" key: {}, value: {}", keyStr, (Supplier<String>) () -> ((value == null) ? "'null'" : value[0]));
630631
}
631632
}
632633
throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "Invalid request, no command sent");
@@ -1011,7 +1012,7 @@ public boolean verifyRequest(final Map<String, Object[]> requestParameters, fina
10111012

10121013
// if api/secret key are passed to the parameters
10131014
if ((signature == null) || (apiKey == null)) {
1014-
logger.debug("Expired session, missing signature, or missing apiKey -- ignoring request. Signature: {}, apiKey: {}", signature, apiKey);
1015+
logger.warn("Expired session, missing signature, or missing apiKey -- ignoring request. Signature: {}, apiKey: {}", signature, apiKey);
10151016
return false; // no signature, bad request
10161017
}
10171018

0 commit comments

Comments
 (0)