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

Removed @PluginAttribute 'patternFlags' argument from @PluginFactory for RegexFilter. (#3086) #3463

Closed
wants to merge 43 commits into from

Conversation

JWT007
Copy link
Contributor

@JWT007 JWT007 commented Feb 12, 2025

(#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.

Comment on lines 130 to 132
@Deprecated
// TODO Consider refactoring to use AbstractFilter.AbstractFilterBuilder
public static RegexFilter createFilter(
Copy link
Contributor

Choose a reason for hiding this comment

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

Whenever we need to modify a factory method, we usually create a Builder class instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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.

Suvrat1629 and others added 28 commits February 16, 2025 09:29
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 <[email protected]>
+ 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] <[email protected]>

* Necessary fixes for `12.0.0` upgrade.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr P. Karwasz <[email protected]>
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ı <[email protected]>
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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
asf-rm and others added 6 commits February 26, 2025 11:26
* Fixed TypeConverters#LevelConverter javadoc (apache#3359)

* Moved changelog to .2.x.x per PR Code Review (apache#3359)

---------

Co-authored-by: Jeff Thomas <[email protected]>
* 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 <[email protected]>
@JWT007 JWT007 linked an issue Mar 2, 2025 that may be closed by this pull request
@JWT007 JWT007 added bug Incorrect, unexpected, or unintended behavior of existing code java Pull requests that update Java code configuration Affects the configuration system in a general way labels Mar 2, 2025
@JWT007 JWT007 self-assigned this Mar 2, 2025
jethomas-tsi and others added 4 commits March 2, 2025 14:10
+ 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
Copy link

github-actions bot commented Mar 2, 2025

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

JWT007 added 4 commits March 2, 2025 16:11
+ added validation checks to RegexFilter
+ added JVerify nullability annotations to RegexFilter
+ updated javadoc
+ replaced deprecated usages of CompositeFilter#getFilters with CompositeFilter#getFiltersArray in AbstractFilterableTest
@JWT007
Copy link
Contributor Author

JWT007 commented Mar 2, 2025

Problems rebasing this PR on 2.x branch - recreated new PR #3512 - closing this one.

@JWT007 JWT007 closed this Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect, unexpected, or unintended behavior of existing code configuration Affects the configuration system in a general way java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix RegexFilter pattern flags
7 participants