mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Log responses from asynchronous api commands
This is mainly useful so that we can see the job ids in the logs whenever the job is created via the API.
This commit is contained in:
parent
5c1ad900a2
commit
7778e24bf7
@ -686,14 +686,21 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
|
||||
s_logger.warn(errorMsg);
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, errorMsg);
|
||||
}
|
||||
|
||||
final String response;
|
||||
if (objectId != null) {
|
||||
final String objUuid = (objectUuid == null) ? objectId.toString() : objectUuid;
|
||||
return getBaseAsyncCreateResponse(jobId, (BaseAsyncCreateCmd)asyncCmd, objUuid);
|
||||
response = getBaseAsyncCreateResponse(jobId, (BaseAsyncCreateCmd)asyncCmd, objUuid);
|
||||
} else {
|
||||
SerializationContext.current().setUuidTranslation(true);
|
||||
return getBaseAsyncResponse(jobId, asyncCmd);
|
||||
response = getBaseAsyncResponse(jobId, asyncCmd);
|
||||
}
|
||||
// Always log response for async for now, I don't think any sensitive data will be in here.
|
||||
// It might be nice to send this through scrubbing similar to how
|
||||
// ApiResponseSerializer.toSerializedStringWithSecureLogs works. For now, this gets jobid's
|
||||
// in the api logs.
|
||||
log.append(response);
|
||||
return response;
|
||||
|
||||
} else {
|
||||
dispatcher.dispatch(cmdObj, params, false);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user