-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Merge feature/log4j-sdk
into main
#2428
Merged
Merged
Conversation
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
In order for Log4j Core 3.x not to depend on the utility classes in Log4j API 2.x, we provide a new `AbstractLogger` in `log4j-sdk`.
After some minor corrections flow message methods are also immediately inlineable.
This PR creates a simplified version of `PropertyEnvironment` in `log4j-sdk` that supports Spring-like property classes. It provides aggregation features to allow the conversion of multiple properties at once in a typesafe way.
Adds support for: * default values, * boxed values, * `Level` properties, * `char[]` (e.g. password) properties.
Co-authored-by: Volkan Yazıcı <[email protected]>
We add tests to ensure that the equivalent of issue #2347 does not affect the new `PropertyEnvironment`.
We move the computation of location and message formatting to the last method call executed before a message leaves the current thread.
This commit ensures that: * an `InstanceFactory` is created in the Log4j `Provider`, * the same factory is injected as parameters to all the components of the chain `Log4jContextFactory`, `ContextSelector`, `LoggerContext` (child), `Configuration` (grand-child). * `DI.createInstanceFactory` is called only when strictly necessary.
This replaces `PropertiesUtil` with `PropertyEnvironment` in modules that depend on Log4j Core. It also ensures that every logger context has a different version of `PropertyEnvironment`.
Property names are often inconsistent. This commit: * changes `log4j.configuration.file` to `log4j.configuration.location`, since the value is not necessarily a file, * the names of property classes end in `Properties`, whereas their prefix starts with a small letter, * the `AsyncLogger` and `AsyncLoggerConfig` properties are merged into one class, since they should not be used together, * the `AuthenticationProvider` is removed from `ConfigurationProperties` and placed in a standalone class, since multiple components use it.
Co-authored-by: Volkan Yazıcı <[email protected]>
The `Cleanup*` JUnit 5 extensions from Log4j API 2.x don't work well together with `Log4jExtension` and try to delete files too soon. We replace them with `TempLoggingDir`.
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.
This PR merges into the
main
development branch the enhancements from the following PRs:AbstractLogger
inlog4j-kit
#2291PropertyEnvironment
tolog4j-kit
#2307PropertiesUtil
withPropertyEnvironment
#2396Recycler
tolog4j-kit
#2400Closes #2290