Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Piotr P. Karwasz
Hi Matt, On Sun, 18 Dec 2022 at 20:30, Matt Sicker wrote: > During this bootstrapping, if the configuration location is available (such > as for a unit test), should LoggerContext set up the configuration provided? > Or is there some sort of cyclic dependency here preventing us from loading >

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Ralph Goers
Ralph > On Dec 28, 2022, at 7:01 AM, Piotr P. Karwasz wrote: > > Hi Matt, > > On Sun, 18 Dec 2022 at 20:30, Matt Sicker wrote: >> During this bootstrapping, if the configuration location is available (such >> as for a unit test), should LoggerContext set up the configuration provided? >>

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Ralph Goers
> On Dec 28, 2022, at 10:37 AM, Ralph Goers wrote: > > > > Ralph > >> On Dec 28, 2022, at 7:01 AM, Piotr P. Karwasz >> wrote: >> >> Hi Matt, >> >> On Sun, 18 Dec 2022 at 20:30, Matt Sicker wrote: >>> During this bootstrapping, if the configuration location is available (such >>> as for

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Piotr P. Karwasz
Hi Ralph On Wed, 28 Dec 2022 at 18:38, Ralph Goers wrote: > > On Dec 28, 2022, at 7:01 AM, Piotr P. Karwasz > > wrote: > > I think we should rely more on our `LifeCycle` abstraction: > > `Configuration` starts in the "initializing" state and does not have > > any subcomponents (especially those

[log4j] The grand infra revamp

2022-12-28 Thread Volkan Yazıcı
Hello, I want to share some updates from my side on what I have been working on for the last couple of months. In particular, I expect certain changes to have an ASF-wide impact! Sounds interesting? Continue reading. *What is up with `maven-changes-plugin`?* The current `site` phase takes ages t

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Matt Sicker
Alright, let me clarify then: Based on how things initialize in Log4j (at least in master, though probably similarly in 2.x), the creation of a LoggerContext is effectively an atomic operation, though it may be constructed more than once before returning a common singleton instance (per ClassLo

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Matt Sicker
Using LifeCycle more would be neat, though its semantics aren’t well defined. In the Injector API, any no-arg method annotated with @Inject is considered equivalent to a @PostConstruct-style method which is similar to `LifeCycle::initialize`. The start() and stop() methods are more domain-speci

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Matt Sicker
And with this detail about the possibility for a Logger to be returned while LoggerContext::start is being executed is indeed a reason for why DefaultConfiguration _normally_ exists. I’m looking at two additional scenarios: 1. What if you provide a configuration location String or URI to the Lo

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Matt Sicker
It’s NullConfiguration that’s the overly-expensive null guard for preventing operations from blowing things up during shutdown. There’s a small period of time between the stopping of Log4j and the stopping of the JVM that other code could still be trying to send new log messages, so they need to

Re: [log4j] The grand infra revamp

2022-12-28 Thread Matt Sicker
This sounds amazing! Thanks for championing this effort! For signing, there’s some project out there that lets you use OIDC for signing things and keeping a sort of certificate transparency log so that you can verify that not only was an artifact signed by a valid signature, but it’s also done b

[log4j] New FlowMessageFactory and LogBuilder methods

2022-12-28 Thread Piotr P. Karwasz
Hi all, Since a little more than a month I have been working on a bytecode conversion tool that converts all logging API calls to chains of `LogBuilder` calls with integrated location information. The most complex API to convert was obviously Log4j2 API, with almost 400 methods to support. This i

Re: [log4j] Question about the initial configuration created in LoggerContext

2022-12-28 Thread Ralph Goers
The reason a DefaultConfiguration is created and NOT the identified configuration is that a) we would have to block while the configuration is created and b) creating a Configuration isn’t necessarily very fast depending on what is in it (some of which we cannot control). We do want logging to b

Re: [log4j] The grand infra revamp

2022-12-28 Thread Ralph Goers
Volkan, Please do not wait to release log4j-tools. I am already holding off adding more changelog entries so as to avoid creating more work when the PR is merged. As far as I can tell there is no requirement that log4j-tools MUST be released via CI. I really would have liked to have all of t