Skip to content

Conversation

@ppkarwasz
Copy link
Contributor

@ppkarwasz ppkarwasz commented Feb 21, 2024

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.

This is based on #2291 and part of #2290.

The main functionality of PropertyEnvironment is to replace a set of properties with keys "Configuration.file", "Configuration.factory", "Configuration.timeout" into a Java record:

@Log4jProperty
public record Configuration(String file, Class<? extends ConfigurationFactory> factory, long timeout)

@ppkarwasz ppkarwasz force-pushed the fix/move-abstractlogger branch from 2dc9115 to 1138990 Compare February 27, 2024 09:20
@ppkarwasz ppkarwasz force-pushed the fix/property-environment branch 3 times, most recently from 3f902c5 to 7458a12 Compare February 27, 2024 19:23
@ppkarwasz ppkarwasz self-assigned this Feb 29, 2024
@ppkarwasz ppkarwasz added the STF-Milestones Milestones funded by the Sovereign Tech Fund label Feb 29, 2024
@ppkarwasz ppkarwasz added this to the 3.x milestone Feb 29, 2024
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.
@ppkarwasz ppkarwasz force-pushed the fix/property-environment branch from 7458a12 to f6825d2 Compare February 29, 2024 14:58
Base automatically changed from fix/move-abstractlogger to feature/log4j-sdk February 29, 2024 15:14
Adds support for:

* default values,
* boxed values,
* `Level` properties,
* `char[]` (e.g. password) properties.
@ppkarwasz ppkarwasz requested review from rgoers and vy March 1, 2024 10:43
Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

I think this is a really good start! There are certain things I don't agree with, though I really liked the direction where this is going. 💯

Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
@ppkarwasz ppkarwasz merged commit 64ebf0d into feature/log4j-sdk Mar 4, 2024
@ppkarwasz ppkarwasz deleted the fix/property-environment branch March 4, 2024 13:09
@ppkarwasz ppkarwasz changed the title Add PropertyEnvironment to log4j-sdk Add PropertyEnvironment to log4j-kit Mar 26, 2024
@ppkarwasz ppkarwasz mentioned this pull request Mar 28, 2024
8 tasks
@vy vy removed the STF-Milestones Milestones funded by the Sovereign Tech Fund label May 31, 2024
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.

3 participants