Skip to content

Commit

Permalink
Updating logs to improve debugging (#83)
Browse files Browse the repository at this point in the history
* Updating logs to improve debugging

---------

Co-authored-by: Avinash Kumar <avinkuma@linkedin.com>
  • Loading branch information
avinas-kumar and Avinash Kumar authored Jun 11, 2024
1 parent a764088 commit 838aaf3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ synchronized HttpClient getHttpClient(State state) {
ConnectionClientFactory factory = (ConnectionClientFactory) factoryClass.newInstance();
httpClient = factory.getHttpClient(state);
} catch (Exception e) {
LOG.error("Error creating HttpClient: {}", e.getMessage());
LOG.error("Error creating HttpClient:", e);
}
}
return httpClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private WorkUnitStatus executeStatement(
try {
stmt.setFetchSize(jdbcSourceKeys.getPaginationInitValues().get(ParameterTypes.PAGESIZE).intValue());
} catch (SQLException e) {
LOG.warn("not able to set fetch size");
LOG.error("Not able to fetch size: ", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ private ByteArrayInputStream handleUpload(Path path, String fileName) {
return new ByteArrayInputStream(
jsonObject.toString().getBytes(StandardCharsets.UTF_8)
);
} catch (IOException e) {
LOG.error("Encountered IO Exception when reading from path: " + path, e);
} catch (Exception e) {
LOG.error("Encountered Exception when reading from path: {}", path);
LOG.error("Error ", e);
return null;
}
}
Expand Down Expand Up @@ -243,7 +244,7 @@ synchronized S3Client getS3HttpClient(State state) {
.credentialsProvider(getCredentialsProvider(state))
.build();
} catch (Exception e) {
LOG.error("Error creating S3 Client: {}", e.getMessage());
LOG.error("Error creating S3 Client", e);
}
}
return s3Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected boolean processInputStream(long starting) {
SchemaUtils.isValidSchemaDefinition(schemaColumns, fieldNames, jobKeys.getDerivedFields().size()));
}
} catch (Exception e) {
LOG.error("Source Error: {}", e.getMessage());
LOG.error("Source Error: ", e);
state.setWorkingState(WorkUnitState.WorkingState.FAILED);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public KeyCertRetriever(State state) {
privateKey = Base64.getEncoder().encodeToString(entry.getPrivateKey().getEncoded());
cert = Base64.getEncoder().encodeToString(entry.getCertificate().getEncoded());
} catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | UnrecoverableEntryException e) {
LOG.error("Error while loading key and cert for Alias : {}", keyAlias);
LOG.error("Error", e);
throw new RuntimeException(e);
}
}
Expand Down

0 comments on commit 838aaf3

Please sign in to comment.