use of org.wso2.carbon.apimgt.internal.service.dto.APILoggingConfigListDTO in project carbon-apimgt by wso2.
the class ApiLoggingConfigsApiServiceImpl method apiLoggingConfigsGet.
public Response apiLoggingConfigsGet(MessageContext messageContext) {
ErrorDTO errorObject = new ErrorDTO();
Response.Status status = Response.Status.NOT_IMPLEMENTED;
errorObject.setCode(200);
errorObject.setMessage(status.toString());
List<APILoggingConfigDTO> loggingAPIDTOList = new ArrayList<>();
try {
List<APILogInfoDTO> apiLoggerList = LoggingMgtDAO.getInstance().retrieveAllAPILoggerList();
for (APILogInfoDTO apiLogInfo : apiLoggerList) {
APILoggingConfigDTO apiLoggingConfigDTO = new APILoggingConfigDTO();
apiLoggingConfigDTO.setContext(apiLogInfo.getContext());
apiLoggingConfigDTO.setLogLevel(apiLogInfo.getLogLevel());
loggingAPIDTOList.add(apiLoggingConfigDTO);
}
} catch (APIManagementException e) {
log.error("Error while retrieving api logger list");
}
APILoggingConfigListDTO apiLoggingConfigListDTO = new APILoggingConfigListDTO();
apiLoggingConfigListDTO.apis(loggingAPIDTOList);
return Response.ok().entity(apiLoggingConfigListDTO).build();
}
Aggregations