Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Updated logging : reduced logging size where not required to be verbose #189

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ abstract class PluginBaseAction<Request : ActionRequest, Response : ActionRespon
try {
listener.onResponse(executeRequest(request, user))
} catch (exception: ElasticsearchStatusException) {
log.warn("$LOG_PREFIX:ElasticsearchStatusException:", exception)
log.warn("$LOG_PREFIX:ElasticsearchStatusException: message:${exception.message}")
listener.onFailure(exception)
} catch (exception: ElasticsearchSecurityException) {
log.warn("$LOG_PREFIX:ElasticsearchSecurityException:", exception)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ internal object ReportDefinitionsIndex {
.source(sourceBuilder)
val actionFuture = client.search(searchRequest)
val response = actionFuture.actionGet(PluginSettings.operationTimeoutMs)
return ReportDefinitionDetailsSearchResults(from.toLong(), response)
val result = ReportDefinitionDetailsSearchResults(from.toLong(), response)
log.info("$LOG_PREFIX:getAllReportDefinitions from:$from, maxItems:$maxItems," +
" retCount:${result.objectList.size}, totalCount:${result.totalHits}")
return result
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ internal object ReportInstancesIndex {
.source(sourceBuilder)
val actionFuture = client.search(searchRequest)
val response = actionFuture.actionGet(PluginSettings.operationTimeoutMs)
return ReportInstanceSearchResults(from.toLong(), response)
val result = ReportInstanceSearchResults(from.toLong(), response)
log.info("$LOG_PREFIX:getAllReportInstances from:$from, maxItems:$maxItems," +
" retCount:${result.objectList.size}, totalCount:${result.totalHits}")
return result
}

/**
Expand Down Expand Up @@ -254,11 +257,12 @@ internal object ReportInstancesIndex {
.source(sourceBuilder)
val actionFuture = client.search(searchRequest)
val response = actionFuture.actionGet(PluginSettings.operationTimeoutMs)
log.warn("$LOG_PREFIX:getPendingReportInstances; response:$response")
val hits = response.hits
log.info("$LOG_PREFIX:getPendingReportInstances; totalHits:${hits.totalHits}, retHits:${hits.hits.size}")
val mutableList: MutableList<ReportInstanceDoc> = mutableListOf()
val currentTime = Instant.now()
val refTime = currentTime.minusSeconds(PluginSettings.jobLockDurationSeconds.toLong())
response.hits.forEach {
hits.forEach {
val parser = XContentType.JSON.xContent().createParser(NamedXContentRegistry.EMPTY,
LoggingDeprecationHandler.INSTANCE,
it.sourceAsString)
Expand Down