我的应用程序在 GAE 中运行。此应用程序对我的 CloudML 进行 REST 调用。
这是代码
GoogleCredential credential = GoogleCredential.getApplicationDefault()
.createScoped(Collections.singleton(CLOUDML_SCOPE));
HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
HttpRequestInitializer requestInitializer = request -> {
credential.initialize(request);
request.setReadTimeout(0);
};
HttpRequestFactory requestFactory = httpTransport.createRequestFactory(
requestInitializer);
GenericUrl url = new GenericUrl(predictRestUrl);
JacksonFactory jacksonFactory = new JacksonFactory();
JsonHttpContent jsonHttpContent = new JsonHttpContent(jacksonFactory, getPayLoad());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
jsonHttpContent.setWrapperKey("instances");
jsonHttpContent.writeTo(baos);
LOG.info("Executing request... " + baos.toString());
HttpRequest request = requestFactory.buildPostRequest(url, jsonHttpContent);
HttpResponse response = request.execute();
我已将 ReadTimeOut 设置为 0,因为我经常收到读取超时异常。
现在使用此代码,我经常从 CloudML 收到以下错误响应
com.google.api.client.http.HttpResponseException: 500 Internal Server Error
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"errors": [
{
"message": "Internal error encountered.",
"domain": "global",
"reason": "backendError"
}
],
"status": "INTERNAL"
}
}
我们在哪里可以获得对 CloudML 的 REST 调用的日志?如何进一步调试?