Removed @PluginAttribute 'patternFlags' argument from @PluginFactory for RegexFilter. (#3086)#3463
Closed
JWT007 wants to merge 43 commits into
Closed
Removed @PluginAttribute 'patternFlags' argument from @PluginFactory for RegexFilter. (#3086)#3463JWT007 wants to merge 43 commits into
JWT007 wants to merge 43 commits into
Conversation
ppkarwasz
reviewed
Feb 16, 2025
Comment on lines
+130
to
+132
| @Deprecated | ||
| // TODO Consider refactoring to use AbstractFilter.AbstractFilterBuilder | ||
| public static RegexFilter createFilter( |
Member
There was a problem hiding this comment.
Whenever we need to modify a factory method, we usually create a Builder class instead.
Contributor
Author
There was a problem hiding this comment.
@ppkarwasz I significantly reworked this one - please review if OK
I reworked it so that all config parameters are accessible via getters (i.e. 'regex') - this sort of comes from my own prroblems with these classes where config parameters are not accessible later making it impossible to see how the element was configured (i.e. to recreate config at runtime). If this is OK I would probably make some new tickets to do the same for some other configuration items.
This PR introduces improvements to `HttpAppender` and adds a new test class, `HttpAppenderBuilderTest`, to enhance test coverage. The changes include: * Updating `HttpAppender` to improve validating behavior. * Adding HttpAppenderBuilderTest.java to verify the builder logic for HttpAppender. Ensuring that missing configurations (e.g., URL, Layout) correctly log errors. Co-authored-by: Piotr P. Karwasz <piotr.github@karwasz.org>
+ made AbstractFiltter.AbstractFilterBuilder onMatch/onMismatch fields protected + added AbstractFilter(AbstractFilterBuilder) constructor + added RegexFilter.Builder implementation + added RegexFilter(Builder) constructor + moved RegexFilter Pattern compile into constructor + added fields to persist configuration propertties + getters (regexExpression, patternFlags) + changed private constructor to accept builder as argument + renamed private method 'targetMessageTest' to more approprriate 'getMessageTextByType' + added Javadoc + grouped deprecations
* Publish build scans to develocity.apache.org * Use `DEVELOCITY_ACCESS_KEY` to authenticate to `develocity.apache.org`
…j-parent (apache#3452) * Bump org.apache.logging:logging-parent in /log4j-parent Bumps [org.apache.logging:logging-parent](https://github.com/apache/logging-parent) from 11.3.0 to 12.0.0. - [Release notes](https://github.com/apache/logging-parent/releases) - [Commits](apache/logging-parent@rel/11.3.0...rel/12.0.0) --- updated-dependencies: - dependency-name: org.apache.logging:logging-parent dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Necessary fixes for `12.0.0` upgrade. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Piotr P. Karwasz <piotr.github@karwasz.org>
This PR starts a separate `verify-reproducibility` job, whenever a snapshot or release is deployed.
This PR starts an `integration-test` job, whenever a snapshot or release is deployed.
Adds a `.logging-parent-bom-activator` file to activate the `bom` profile.
Fixes the formatting of the single `s` pattern. Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Bumps commons-logging:commons-logging from 1.3.4 to 1.3.5. --- updated-dependencies: - dependency-name: commons-logging:commons-logging dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…r` (apache#3467) Co-authored-by: Josh Smith <jesmith17@gmail.com>
* Fixed TypeConverters#LevelConverter javadoc (apache#3359) * Moved changelog to .2.x.x per PR Code Review (apache#3359) --------- Co-authored-by: Jeff Thomas <jeffrey.thomas@t-systems.com>
* Fixed AbstractFilterable#isFiltered javadoc (apache#3300) * Moved changelog to .2.x.x per PR Code Review (apache#3300) * Fixed AbstractFilterable#isFiltered javadoc (apache#3300) * Moved changelog to .2.x.x per PR Code Review (apache#3300) --------- Co-authored-by: Jeff Thomas <jeffrey.thomas@t-systems.com>
+ made AbstractFiltter.AbstractFilterBuilder onMatch/onMismatch fields protected + added AbstractFilter(AbstractFilterBuilder) constructor + added RegexFilter.Builder implementation + added RegexFilter(Builder) constructor + moved RegexFilter Pattern compile into constructor + added fields to persist configuration propertties + getters (regexExpression, patternFlags) + changed private constructor to accept builder as argument + renamed private method 'targetMessageTest' to more approprriate 'getMessageTextByType' + added Javadoc + grouped deprecations
Contributor
+ added validation checks to RegexFilter + added JVerify nullability annotations to RegexFilter + updated javadoc + replaced deprecated usages of CompositeFilter#getFilters with CompositeFilter#getFiltersArray in AbstractFilterableTest
Contributor
Author
|
Problems rebasing this PR on 2.x branch - recreated new PR #3512 - closing this one. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(#3086)
Removed @PluginAttribute 'patternFlags' argument from @pluginfactory for RegexFilter.
Actually created new @pluginfactory without the argument and deprecated old 'createFilter' method.
See ticket for discussion of the reasoning - short version - pattern flags can be passed as part of RegEx expression.
Also guarded the "PatternCompile" method against excepttions - logging and returning null if the pattern fails to compile.