Skip to content
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

FINERACT-1754: Turn off unnecessary logging #2621

Merged
merged 1 commit into from Sep 27, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -62,7 +62,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
.append("from acc_gl_journal_entry je WHERE je.transaction_date = ? ")
.append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)");
final int result = jdbcTemplate.update(sqlBuilder.toString(), tbGap);
log.info("{}: Records affected by updateTrialBalanceDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
log.debug("{}: Records affected by updateTrialBalanceDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
}
String distinctOfficeQuery = "select distinct(office_id) from m_trial_balance where closing_balance is null group by office_id";
final List<Long> officeIds = jdbcTemplate.queryForList(distinctOfficeQuery, Long.class);
Expand Down
Expand Up @@ -199,7 +199,7 @@ public Page<AuditData> retrievePaginatedAuditEntries(final SQLBuilder extraCrite
this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.limitSql());
}

log.info("sql: {}", sqlBuilder);
log.debug("sql: {}", sqlBuilder);

return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlBuilder.toString(), extraCriteria.getArguments(), rm);
}
Expand Down Expand Up @@ -238,7 +238,7 @@ private Collection<AuditData> retrieveEntries(final String useType, final SQLBui
}
sql += extraCriteria.getSQLTemplate();
sql += groupAndOrderBySQL;
log.info("sql: {}", sql);
log.debug("sql: {}", sql);

return this.jdbcTemplate.query(sql, rm, extraCriteria.getArguments()); // NOSONAR
}
Expand Down
Expand Up @@ -91,7 +91,7 @@ public CommandProcessingResult logCommandSource(final CommandWrapper wrapper) {
result = this.processAndLogCommandService.executeCommand(wrapper, command, isApprovedByChecker);
numberOfRetries = maxNumberOfRetries + 1;
} catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) {
log.info("The following command {} has been retried {} time(s)", command.json(), numberOfRetries);
log.debug("The following command {} has been retried {} time(s)", command.json(), numberOfRetries);
/***
* Fail if the transaction has been retired for maxNumberOfRetries
**/
Expand Down
Expand Up @@ -89,13 +89,13 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
smsMessageRepository.save(smsMessage);

if (statusChanged) {
log.info("Status of SMS message id: {} successfully changed to {}", smsMessage.getId(), statusType);
log.debug("Status of SMS message id: {} successfully changed to {}", smsMessage.getId(), statusType);
}
}
}
}
if (!CollectionUtils.isEmpty(smsMessageDeliveryReportDataCollection)) {
log.info("{} delivery report(s) successfully received from the intermediate gateway - sms",
log.debug("{} delivery report(s) successfully received from the intermediate gateway - sms",
smsMessageDeliveryReportDataCollection.size());
}
}
Expand Down
Expand Up @@ -72,7 +72,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
LocalDateTime tenantDateNow = TenantDateTimeUtil.tenantDateTime();
LocalDateTime nextTriggerDate = emailCampaignData.getNextTriggerDate().toLocalDateTime();

log.info("tenant time {} trigger time {}", tenantDateNow, nextTriggerDate);
log.debug("tenant time {} trigger time {}", tenantDateNow, nextTriggerDate);
if (nextTriggerDate.isBefore(tenantDateNow)) {
insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(), emailCampaignData.getEmailSubject(),
emailCampaignData.getMessage(), emailCampaignData.getCampaignName(), emailCampaignData.getId());
Expand Down
Expand Up @@ -54,7 +54,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
LocalDateTime tenantDateNow = TenantDateTimeUtil.tenantDateTime();
LocalDateTime nextTriggerDate = smsCampaign.getNextTriggerDate();

log.info("tenant time {} trigger time {} {}", tenantDateNow, nextTriggerDate,
log.debug("tenant time {} trigger time {} {}", tenantDateNow, nextTriggerDate,
JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name());
if (nextTriggerDate.isBefore(tenantDateNow)) {
smsCampaignWritePlatformService.insertDirectCampaignIntoSmsOutboundTable(smsCampaign);
Expand Down
Expand Up @@ -452,7 +452,7 @@ private List<HashMap<String, Object>> getRunReportByServiceImpl(final String rep
final String response = this.genericDataService.generateJsonFromGenericResultsetData(results);
resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String, Object>>>() {});
} catch (JsonParseException e) {
log.info("Conversion of report query results to JSON failed", e);
log.warn("Conversion of report query results to JSON failed", e);
return resultList;
}
// loop changes array date to string date
Expand Down
Expand Up @@ -81,10 +81,10 @@ public String getMessage() {
@Override
@SuppressWarnings("RegexpSinglelineJava")
public void printStackTrace() {
LOG.info("{}", super.getMessage());
LOG.error("{}", super.getMessage());
int i = 0;
for (Throwable e : throwables) {
LOG.info("{}.", ++i);
LOG.error("{}.", ++i);
e.printStackTrace();
}
}
Expand Down
Expand Up @@ -60,13 +60,13 @@ private void shutDowncleanUpThreadAndDeregisterJDBCDriver() {
java.sql.DriverManager.deregisterDriver(driver);
LOG.info("JDBC driver de-registered successfully");
} catch (Throwable t) {
LOG.error("Exception occured while deristering jdbc driver", t);
LOG.error("Exception occurred while de-register jdbc driver", t);
}
}
try {
Thread.sleep(2000L);
} catch (Exception e) {
LOG.error("Exception Occcured while trying to sleep.", e);
LOG.error("Exception Occcurred while trying to sleep.", e);
}
}
}
Expand Up @@ -107,7 +107,7 @@ public CommandProcessingResult createCheck(final JsonCommand command) {
final String foreignKeyColumnName = EntityTables.getForeignKeyColumnNameOnDatatable(entity);
final boolean columnExist = datatableData.hasColumn(foreignKeyColumnName);

LOG.info("{} has column {} ? {}", datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist);
LOG.debug("{} has column {} ? {}", datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist);

if (!columnExist) {
throw new EntityDatatableCheckNotSupportedException(datatableData.getRegisteredTableName(), entity);
Expand Down Expand Up @@ -170,7 +170,7 @@ public void runTheCheck(final Long entityId, final String entityName, final Long
final String datatableName = t.getDatatableName();
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);

LOG.info("The are {} entries in the table {}", countEntries, datatableName);
LOG.debug("The are {} entries in the table {}", countEntries, datatableName);
if (countEntries.intValue() == 0) {
reqDatatables.add(datatableName);
}
Expand Down Expand Up @@ -199,7 +199,7 @@ public void runTheCheckForProduct(final Long entityId, final String entityName,
final String datatableName = t.getDatatableName();
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);

LOG.info("The are {} entries in the table {}", countEntries, datatableName);
LOG.debug("The are {} entries in the table {}", countEntries, datatableName);
if (countEntries.intValue() == 0) {
reqDatatables.add(datatableName);
}
Expand Down
Expand Up @@ -104,7 +104,7 @@ private StringBuilder generateCsvFileBuffer(final GenericResultsetData result) {
final StringBuilder writer = new StringBuilder();

final List<ResultsetColumnHeaderData> columnHeaders = result.getColumnHeaders();
log.info("NO. of Columns: {}", columnHeaders.size());
log.debug("NO. of Columns: {}", columnHeaders.size());
final Integer chSize = columnHeaders.size();
for (int i = 0; i < chSize; i++) {
writer.append('"' + columnHeaders.get(i).getColumnName() + '"');
Expand All @@ -122,7 +122,7 @@ private StringBuilder generateCsvFileBuffer(final GenericResultsetData result) {
String currVal;
final String doubleQuote = "\"";
final String twoDoubleQuotes = doubleQuote + doubleQuote;
log.info("NO. of Rows: {}", data.size());
log.debug("NO. of Rows: {}", data.size());
for (ResultsetRowData element : data) {
row = element.getRow();
rSize = row.size();
Expand Down Expand Up @@ -254,7 +254,7 @@ public String retrieveReportPDF(final String reportName, final String type, fina
final List<ResultsetRowData> data = result.getData();
List<Object> row;

log.info("NO. of Columns: {}", columnHeaders.size());
log.debug("NO. of Columns: {}", columnHeaders.size());
final Integer chSize = columnHeaders.size();

final Document document = new Document(PageSize.B0.rotate());
Expand All @@ -276,7 +276,7 @@ public String retrieveReportPDF(final String reportName, final String type, fina
Integer rSize;
String currColType;
String currVal;
log.info("NO. of Rows: {}", data.size());
log.debug("NO. of Rows: {}", data.size());
for (ResultsetRowData element : data) {
row = element.getRow();
rSize = row.size();
Expand Down Expand Up @@ -484,14 +484,14 @@ public ReportParameterData mapRow(final ResultSet rs, final int rowNum) throws S
@Override
public GenericResultsetData retrieveGenericResultSetForSmsEmailCampaign(String name, String type, Map<String, String> queryParams) {
final long startTime = System.currentTimeMillis();
log.info("STARTING REPORT: {} Type: {}", name, type);
log.debug("STARTING REPORT: {} Type: {}", name, type);

final String sql = sqlToRunForSmsEmailCampaign(name, type, queryParams);

final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);

final long elapsed = System.currentTimeMillis() - startTime;
log.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", name, type, elapsed);
log.debug("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", name, type, elapsed);
return result;
}

Expand Down
Expand Up @@ -184,7 +184,7 @@ public DatatableData retrieveDatatable(final String datatable) {
}

private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
LOG.error("Error occured.", dve);
LOG.error("Error occurred.", dve);
}

@Transactional
Expand Down Expand Up @@ -806,7 +806,7 @@ private int getCodeIdForColumn(final String dataTableNameAlias, final String nam
try {
codeId = this.jdbcTemplate.queryForObject(checkColumnCodeMapping.toString(), Integer.class);
} catch (final EmptyResultDataAccessException e) {
LOG.info("Error occured.", e);
LOG.warn("Error occurred.", e);
}
return ObjectUtils.defaultIfNull(codeId, 0);
}
Expand Down Expand Up @@ -1228,11 +1228,11 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
pkValue = datatableId;
}
final String sql = getUpdateSql(grs.getColumnHeaders(), dataTableName, pkName, pkValue, changes);
LOG.info("Update sql: {}", sql);
LOG.debug("Update sql: {}", sql);
if (StringUtils.isNotBlank(sql)) {
this.jdbcTemplate.update(sql);
} else {
LOG.info("No Changes");
LOG.debug("No Changes");
}
}

Expand Down Expand Up @@ -1574,7 +1574,7 @@ private String getAddSql(final List<ResultsetColumnHeaderData> columnHeaders, fi
addSql = "insert into " + sqlGenerator.escape(datatable) + " (" + sqlGenerator.escape(fkName) + " " + insertColumns + ")"
+ " select " + appTableId + " as id" + selectColumns;

LOG.info("{}", addSql);
LOG.debug("{}", addSql);

return addSql;
}
Expand Down Expand Up @@ -1624,7 +1624,7 @@ public String getAddSqlWithScore(final List<ResultsetColumnHeaderData> columnHea
+ ", score )" + " select " + appTableId + " as id" + selectColumns
+ " , ( SELECT SUM( code_score ) FROM m_code_value WHERE m_code_value.id IN (" + scoresId + " ) ) as score";

LOG.info("{}", vaddSql);
LOG.debug("{}", vaddSql);

return vaddSql;
}
Expand Down
Expand Up @@ -164,7 +164,7 @@ private void putObject(final String filename, final InputStream inputStream, fin

private S3Object getObject(String key) {
try {
log.info("Downloading an object from Amazon S3 Bucket: {}, location: {}", this.s3BucketName, key);
log.debug("Downloading an object from Amazon S3 Bucket: {}, location: {}", this.s3BucketName, key);
return this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, key));
} catch (AmazonClientException ase) {
throw new ContentManagementException(key, ase.getMessage(), ase);
Expand Down
Expand Up @@ -102,12 +102,12 @@ public Callback createCallback(final String url) {

@Override
public void onResponse(@SuppressWarnings("unused") Call call, retrofit2.Response response) {
LOG.info("URL: {} - Status: {}", url, response.code());
LOG.debug("URL: {} - Status: {}", url, response.code());
}

@Override
public void onFailure(@SuppressWarnings("unused") Call call, Throwable t) {
LOG.error("URL: {} - Retrofit failure occured", url, t);
LOG.error("URL: {} - Retrofit failure occurred", url, t);
}
};
}
Expand All @@ -129,7 +129,7 @@ public Callback createCallback(final String url, String payload) {

@Override
public void onResponse(@SuppressWarnings("unused") Call call, retrofit2.Response response) {
LOG.info("URL: {} - Status: {}", url, response.code());
LOG.debug("URL: {} - Status: {}", url, response.code());
}

@Override
Expand Down
Expand Up @@ -84,7 +84,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon

final int result = jdbcTemplate.update(updateSqlBuilder.toString(), user.getId(), DateUtils.getOffsetDateTimeOfTenant());

log.info("{}: Records affected by updateNPA: {}", ThreadLocalContextUtil.getTenant().getName(), result);
log.debug("{}: Records affected by updateNPA: {}", ThreadLocalContextUtil.getTenant().getName(), result);
return RepeatStatus.FINISHED;
}
}
Expand Up @@ -150,7 +150,7 @@ public void doFilter(final ServletRequest req, final ServletResponse res, final
} finally {
task.stop();
final PlatformRequestLog logRequest = PlatformRequestLog.from(task, request);
log.info("{}", this.toApiJsonSerializer.serialize(logRequest));
log.debug("{}", this.toApiJsonSerializer.serialize(logRequest));
}

}
Expand Down
Expand Up @@ -140,7 +140,7 @@ public void sendTriggeredMessage(Collection<SmsMessage> smsMessages, long provid
}
this.smsMessageRepository.saveAll(smsMessages);
request.append(SmsMessageApiQueueResourceData.toJsonString(apiQueueResourceDatas));
log.info("Sending triggered SMS to specific provider with request - {}", request);
log.debug("Sending triggered SMS to specific provider with request - {}", request);
this.triggeredExecutorService.execute(new SmsTask(apiQueueResourceDatas, ThreadLocalContextUtil.getContext()));
} catch (Exception e) {
log.error("Error occured.", e);
Expand Down
Expand Up @@ -63,7 +63,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
Map<String, JobParameter> jobParameters = chunkContext.getStepContext().getStepExecution().getJobParameters().getParameters();
if (!jobParameters.isEmpty()) {
final String officeId = (String) jobParameters.get("officeId").getValue();
log.info("recalculateInterest: officeId={}", officeId);
log.debug("recalculateInterest: officeId={}", officeId);
Long officeIdLong = Long.valueOf(officeId);

final OfficeData office = officeReadPlatformService.retrieveOffice(officeIdLong);
Expand All @@ -82,14 +82,14 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
if (!loanIds.isEmpty()) {
List<Throwable> errors = new ArrayList<>();
for (Long loanId : loanIds) {
log.info("recalculateInterest: Loan ID = {}", loanId);
log.debug("recalculateInterest: Loan ID = {}", loanId);
int numberOfRetries = 0;
while (numberOfRetries <= maxNumberOfRetries) {
try {
loanWritePlatformService.recalculateInterest(loanId);
numberOfRetries = maxNumberOfRetries + 1;
} catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) {
log.info("Recalulate interest job has been retried {} time(s)", numberOfRetries);
log.debug("Recalulate interest job has been retried {} time(s)", numberOfRetries);
if (numberOfRetries >= maxNumberOfRetries) {
log.error(
"Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back",
Expand All @@ -113,7 +113,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
}
i++;
}
log.info("recalculateInterest: Loans count {}", i);
log.debug("recalculateInterest: Loans count {}", i);
}
if (!errors.isEmpty()) {
throw new JobExecutionException(errors);
Expand All @@ -136,7 +136,7 @@ private void recalculateInterest(OfficeData office, int threadPoolSize, int batc

do {
int totalFilteredRecords = loanIds.size();
log.info("Starting accrual - total filtered records - {}", totalFilteredRecords);
log.debug("Starting accrual - total filtered records - {}", totalFilteredRecords);
recalculateInterest(loanIds, threadPoolSize, batchSize, executorService);
maxLoanIdInList += pageSize + 1;
loanIds = Collections.synchronizedList(
Expand Down
Expand Up @@ -83,7 +83,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
result += i;
}

log.info("{}: Records affected by updateLoanArrearsAgeingDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
log.debug("{}: Records affected by updateLoanArrearsAgeingDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
return RepeatStatus.FINISHED;
}

Expand Down