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

Merge feature/log4j-sdk into main #2428

Merged
merged 51 commits into from
Mar 29, 2024
Merged

Merge feature/log4j-sdk into main #2428

merged 51 commits into from
Mar 29, 2024

Conversation

ppkarwasz and others added 30 commits February 26, 2024 13:31
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]>
@ppkarwasz ppkarwasz merged commit 307a51e into main Mar 29, 2024
9 checks passed
@ppkarwasz ppkarwasz deleted the feature/log4j-sdk branch March 29, 2024 13:36
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.

1 participant