-
Notifications
You must be signed in to change notification settings - Fork 18
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
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,6 @@ | ||||||
# Release Notes | ||||||
## [4.4.2] - 2024-10-TBD | ||||||
## [4.4.2] - 2024-10-03 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- Upgraded to use log4j 2.x and included a template properties file that will help separate general logs from CDM class specific logs including a separate log for rows identified by `DiffData` (Validation) errors. | ||||||
- Upgraded to use Spark `3.5.3`. | ||||||
|
||||||
## [4.4.1] - 2024-09-20 | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,8 +173,6 @@ public List<Number> getNumberList(String propertyName) { | |
|
||
@Override | ||
public List<Integer> getIntegerList(String propertyName) { | ||
List<Integer> intList = new ArrayList<>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch 👍🏼 |
||
Integer i; | ||
if (null == propertyName || PropertyType.NUMBER_LIST != getType(propertyName) | ||
|| null == getNumberList(propertyName)) | ||
return null; | ||
|
@@ -188,7 +186,6 @@ public Boolean getBoolean(String propertyName) { | |
|
||
@Override | ||
public String getAsString(String propertyName) { | ||
String rtn; | ||
if (null == propertyName) | ||
return null; | ||
PropertyType t = getType(propertyName); | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright DataStax, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
appender.0.type = Console | ||
appender.0.name = CONSOLE | ||
appender.0.layout.type = PatternLayout | ||
appender.0.layout.pattern = %d %-5p [%t] %c{1}:%L - %m%n | ||
|
||
appender.1.type = RollingFile | ||
appender.1.name = MAIN | ||
appender.1.fileName = cdm_logs/cdm.log | ||
appender.1.filePattern = cdm_logs/cdm.%d{yyyy-MM-dd-HHmm}.%i.log | ||
appender.1.layout.type = PatternLayout | ||
appender.1.layout.pattern = %d %-5p [%t] %c{1}:%L - %m%n | ||
appender.1.policy.type = Policies | ||
appender.1.policy.0.type = OnStartupTriggeringPolicy | ||
appender.1.policy.1.type = SizeBasedTriggeringPolicy | ||
appender.1.policy.1.size = 10m | ||
|
||
appender.2.type = RollingFile | ||
appender.2.name = DIFF | ||
appender.2.fileName = cdm_logs/cdm_diff.log | ||
appender.2.filePattern = cdm_logs/cdm_diff.%d{yyyy-MM-dd-HHmm}.%i.log | ||
appender.2.layout.type = PatternLayout | ||
appender.2.layout.pattern = %d %-5p [%t] %c{1}:%L - %m%n | ||
appender.2.policy.type = Policies | ||
appender.2.policy.0.type = OnStartupTriggeringPolicy | ||
appender.2.policy.1.type = SizeBasedTriggeringPolicy | ||
appender.2.policy.1.size = 10m | ||
|
||
rootLogger.level = INFO | ||
rootLogger.appenderRef.0.ref = CONSOLE | ||
rootLogger.appenderRef.0.level = INFO | ||
|
||
logger.0.name = com.datastax.cdm | ||
logger.0.level = INFO | ||
logger.0.additivity = false | ||
logger.0.appenderRef.0.ref = MAIN | ||
|
||
logger.1.name = com.datastax.cdm.job.DiffJobSession | ||
logger.1.level = ERROR | ||
logger.1.additivity = false | ||
logger.1.appenderRef.0.ref = DIFF |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
diff
related logs (i.e. details ofmissing
&mismatched
rows) will be recorded in./cdm_logs/cdm.log
file.diff
related logs (i.e. details ofmissing
&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.
There was a problem hiding this comment.
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 togrep
& find it.