use of org.wso2.carbon.apimgt.impl.dto.APILogInfoDTO in project carbon-apimgt by wso2.
the class LoggingMgtDAO method retrieveAPILoggerByAPIID.
public List<APILogInfoDTO> retrieveAPILoggerByAPIID(String tenant, String apiId) throws APIManagementException {
String query = SQLConstants.RETRIEVE_PER_API_LOGGING_BY_UUID_SQL;
List<APILogInfoDTO> apiLogInfoDTOList = new ArrayList<>();
try (Connection connection = APIMgtDBUtil.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(query)) {
preparedStatement.setString(1, apiId);
preparedStatement.setString(2, tenant);
try (ResultSet resultSet = preparedStatement.executeQuery()) {
while (resultSet.next()) {
String logLevel = APIConstants.LOG_LEVEL_OFF;
if (resultSet.getString(APIConstants.LOG_LEVEL) != null) {
logLevel = resultSet.getString(APIConstants.LOG_LEVEL);
}
APILogInfoDTO apiLogInfoDTO = new APILogInfoDTO(resultSet.getString(API_UUID), resultSet.getString(CONTEXT), logLevel);
apiLogInfoDTOList.add(apiLogInfoDTO);
}
}
} catch (SQLException e) {
handleException("Failed to retrieve organization", e);
}
return apiLogInfoDTOList;
}
use of org.wso2.carbon.apimgt.impl.dto.APILogInfoDTO in project carbon-apimgt by wso2.
the class TenantLogsApiServiceImpl method tenantLogsTenantIdApisGet.
public Response tenantLogsTenantIdApisGet(String tenantId, String logLevel, MessageContext messageContext) throws APIManagementException {
APILoggingImpl apiLoggingImpl = new APILoggingImpl();
List<APILogInfoDTO> apiLogInfoDTOList = apiLoggingImpl.getAPILoggerList(tenantId, logLevel);
LoggingApiOutputListDTO loggingApiOutputListDTO = DevopsAPIUtils.getLoggingAPIList(apiLogInfoDTOList);
return Response.ok().entity(loggingApiOutputListDTO).build();
}
Aggregations