Skip to content

HMAN-581 update logging statements #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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 @@ -60,11 +60,11 @@ public boolean submittedDateTimePeriodElapsed(PendingRequestEntity pendingReques
LocalDateTime currentDateTime = LocalDateTime.now();
LocalDateTime submittedDateTime = pendingRequest.getSubmittedDateTime();
long hoursElapsed = ChronoUnit.HOURS.between(submittedDateTime, currentDateTime);
log.debug("Hours elapsed = {}; submittedDateTime: {}; currentDateTime: {}",
log.info("Hours elapsed = {}; submittedDateTime: {}; currentDateTime: {}",
hoursElapsed, submittedDateTime, currentDateTime);
boolean result = false;
if (hoursElapsed >= exceptionLimitInHours) {
log.debug("Marking hearing request {} as Exception (hours elapsed exceeds limit!)",
log.info("Marking hearing request {} as Exception (hours elapsed exceeds limit!)",
pendingRequest.getHearingId());
markRequestWithGivenStatus(pendingRequest.getId(), PendingStatusType.EXCEPTION.name());
log.error("Submitted time of request with ID {} is {} hours later than before.",
Expand All @@ -83,7 +83,7 @@ public boolean lastTriedDateTimePeriodElapsed(PendingRequestEntity pendingReques

long minutesElapsed = ChronoUnit.MINUTES.between(lastTriedDateTime, LocalDateTime.now());
boolean result = retryLimitInMinutes < minutesElapsed;
log.debug("lastTriedDateTimePeriodNotElapsed()={} retryLimitInMinutes<{}> hearingId<{}> Minutes elapsed<{}> "
log.info("lastTriedDateTimePeriodNotElapsed()={} retryLimitInMinutes<{}> hearingId<{}> Minutes elapsed<{}> "
+ "submittedDateTime<{}> currentDateTime<{}>",
result, retryLimitInMinutes, pendingRequest.getHearingId(), minutesElapsed, lastTriedDateTime,
LocalDateTime.now());
Expand All @@ -93,7 +93,7 @@ public boolean lastTriedDateTimePeriodElapsed(PendingRequestEntity pendingReques
public List<PendingRequestEntity> findAndLockByHearingId(Long hearingId) {
List<PendingRequestEntity> lockedRequests =
pendingRequestRepository.findAndLockByHearingId(hearingId);
log.debug(
log.info(
"{} locked records = findAndLockByHearingId({})",
null == lockedRequests ? 0 : lockedRequests.size(),
hearingId
Expand All @@ -107,7 +107,7 @@ public List<PendingRequestEntity> findQueuedPendingRequestsForProcessing() {
getIntervalUnits(pendingWaitInterval), getIntervalMeasure(pendingWaitInterval));
if (!pendingRequests.isEmpty()) {
pendingRequests.forEach(e ->
log.debug("findQueuedPendingRequestsForProcessing(): id<{}> hearingId<{}> ",
log.info("findQueuedPendingRequestsForProcessing(): id<{}> hearingId<{}> ",
e.getId(), e.getHearingId()));
} else {
log.debug("findQueuedPendingRequestsForProcessing(): empty");
Expand All @@ -124,7 +124,7 @@ public void markRequestAsPending(Long id, Integer retryCountIn, LocalDateTime la
}

public void markRequestWithGivenStatus(Long id, String status) {
log.debug("markRequestWithGivenStatus({}, {})", id, status);
log.info("markRequestWithGivenStatus({}, {})", id, status);
pendingRequestRepository.markRequestWithGivenStatus(id, status);
}

Expand All @@ -151,7 +151,7 @@ public void catchExceptionAndUpdateHearing(Long hearingId, Exception exception)
}

public void escalatePendingRequests() {
log.debug("escalatePendingRequests()");
log.info("escalatePendingRequests()");

try {
List<PendingRequestEntity> pendingRequests =
Expand All @@ -165,7 +165,7 @@ public void escalatePendingRequests() {
}

public void deleteCompletedPendingRequests() {
log.debug("deleteCompletedPendingRequests({})", deletionWaitInterval);
log.info("deleteCompletedPendingRequests({})", deletionWaitInterval);
try {
int countOfDeletedRecords = pendingRequestRepository.deleteCompletedRecords(
getIntervalUnits(deletionWaitInterval), getIntervalMeasure(deletionWaitInterval));
Expand All @@ -176,7 +176,7 @@ public void deleteCompletedPendingRequests() {
}

protected void escalatePendingRequest(PendingRequestEntity pendingRequest) {
log.debug("escalatePendingRequests");
log.info("escalatePendingRequests");
pendingRequestRepository.markRequestForEscalation(pendingRequest.getId(), LocalDateTime.now());

log.error("Error occurred during service bus processing. Service:{}. Entity:{}. Method:{}. Hearing ID:{}.",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ LOGGING:
gov:
hmcts:
reform:
hmc: DEBUG
hmc: INFO

logging:
level:
Expand Down