Re: Order of property sources

2022-03-15 Thread Ralph Goers
That is actually an interesting question. If you look at the logic, all the providers are loaded. They are then looped through and the first one that returns a LoggerFactory is used. I really consider this code unfinished. When I wrote it I considered supporting multiple logging implementations

Re: Order of property sources

2022-03-15 Thread Tim Perry
In that case, should log4j log a warning if more than one provider is included? Tim > On Mar 15, 2022, at 1:44 PM, Ralph Goers wrote: > > I would not be in favor of this change. Providers have been designed since > day one that highest wins and it is documented - > https://logging.apache.or

Re: Order of property sources

2022-03-15 Thread Ralph Goers
I would not be in favor of this change. Providers have been designed since day one that highest wins and it is documented - https://logging.apache.org/log4j/2.x/manual/extending.html#LoggerContextFactory . The fa

Re: Order of property sources

2022-03-14 Thread Piotr P. Karwasz
On Mon, Mar 14, 2022 at 10:54 AM Volkan Yazıcı wrote: > Regarding your remark about providers... `Provider#getPriority()` has the > following javadoc: *"Gets the priority (natural ordering) of this Provider"*, > hence I would have expected it to work the same lowest-comes-first way, but > apparent

Re: Order of property sources

2022-03-14 Thread Volkan Yazıcı
Okay, then we have consensus for changing the property source priority field handling to lowest-comes-first strategy. I recommend landing this feature in 2.18.0 rather than 2.17.3 or something, since this is potentially a breaking change of a not working feature. Regarding your remark about provid

Re: Order of property sources

2022-03-14 Thread Piotr P. Karwasz
Hi Volkan, On Mon, Mar 14, 2022 at 9:23 AM Volkan Yazıcı wrote: > My preference would be the *lowest-value-comes-first* strategy for the > following reasons: > >- Natural ordering in Java (e.g., `Stream#sorted()`) yields the same >result >- This is how it works for Spring's `@Order` a

Re: Order of property sources

2022-03-14 Thread Volkan Yazıcı
My preference would be the *lowest-value-comes-first* strategy for the following reasons: - Natural ordering in Java (e.g., `Stream#sorted()`) yields the same result - This is how it works for Spring's `@Order` annotation I would appreciate it if you can align javadoc and manual with thi

Order of property sources

2022-03-09 Thread Piotr P. Karwasz
Hello, Among the problems I found in the ordering of property sources[1], there is the question of the meaning of the numeric priority value: * the manual says that lower numeric values override higher values[2], * the Javadoc suggests an inverted order[3]. Which one should be the correct one? A

Re: LOG4J2-3366 Fix order of property sources

2022-02-01 Thread Matt Sicker
Seems reasonable. I think the initial idea was that environment variables were easier to configure after the fact than system properties, so env vars had highest precedence. However, I guess that doesn't work too well with system properties, so reversing them seems ok. On Tue, Feb 1, 2022 at 6:37

LOG4J2-3366 Fix order of property sources

2022-02-01 Thread Volkan Yazıcı
I agree with the points of Piotr P. Karwasz in LOG4J2-3366 . Unless there are objections, I will ask for a PR.