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

Implemented capability to separate diff logs via log4j2 #315

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

pravinbhat
Copy link
Collaborator

@pravinbhat pravinbhat commented Oct 3, 2024

What this PR does: Implements capability to separate diff logs via log4j2

Which issue(s) this PR fixes:
Fixes #

Checklist:

  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

msmygit
msmygit previously approved these changes Oct 3, 2024
./spark-submit --properties-file cdm.properties \
--conf spark.cdm.schema.origin.keyspaceTable="<keyspacename>.<tablename>" \
--conf "spark.executor.extraJavaOptions='-Dlog4j.configurationFile=log4j2.properties'" \
--conf "spark.driver.extraJavaOptions='-Dlog4j.configurationFile=log4j2.properties'" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will be the name of the 2 log files that will get generated? Could we show that as an example? TY

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the details of the log file are in the log4j2.properties file. CDM users can change the details as needed, but if they use the file as-is, the logs will be directed 3 ways as below

  • All non app related logs (i.e. logs generated by libraries & not CDM code) will continue to be written to console
  • All logs generated by CDM code except for the diff related logs (i.e. details of missing & mismatched rows) will be recorded in ./cdm_logs/cdm.log file.
  • All diff related logs (i.e. details of missing & mismatched rows) will be recorded in ./cdm_logs/cdm_diff.log file.

Note: All log files will be rolled when they cross the set size limit (default is 10MB), there can be 100 rollovers by default.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context, most customers will not use this feature, but some customers who plan to run only validation & expect to have a lot of diff rows want a separate file for such records in a separate file instead of having to grep & find it.

RELEASE.md Outdated
@@ -1,5 +1,6 @@
# Release Notes
## [4.4.2] - 2024-10-TBD
## [4.4.2] - 2024-10-03
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## [4.4.2] - 2024-10-03
## [4.5.0] - 2024-10-03

@@ -173,8 +173,6 @@ public List<Number> getNumberList(String propertyName) {

@Override
public List<Integer> getIntegerList(String propertyName) {
List<Integer> intList = new ArrayList<>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍🏼

@msmygit msmygit dismissed their stale review October 3, 2024 13:02

Build failed.

@pravinbhat
Copy link
Collaborator Author

Looking into what made the build fail

Copy link
Collaborator

@msmygit msmygit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼

@pravinbhat pravinbhat merged commit 42650d9 into main Oct 4, 2024
9 checks passed
@pravinbhat pravinbhat deleted the feature/separate-diff-logs branch October 4, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants