> On Jan 18, 2024, at 8:14 AM, Ralph Goers <ralph.go...@dslextreme.com> wrote:
>
>
>
>> On Jan 18, 2024, at 7:55 AM, Ralph Goers <ralph.go...@dslextreme.com> wrote:
>>
>>
>>
>>> On Jan 18, 2024, at 5:37 AM, Volkan Yazıcı <vol...@yazi.ci> wrote:
>>>
>>> If we
>>>
>>> 1. move all non-API (`AbstractLogger`, `PropertiesUtil`, etc.) classes
>>> in `log4j-api-3.x` to a new `log4j-spi-3.x` module, and
>>> 2. Only implement `log4j-api-2.x` *interfaces* (not abstract classes!)
>>> in `log4j-core`
>>>
>>> we can have a Log4j 3 without a `log4j-api-3.x` module, right?
>>
>> Spring uses PropertiesUtil. I suspect it isn’t alone. That would mean
>> anything impacted by the property changes would have to be in the spi or
>> abstracted to reference something in the spi. I am assuming a log4j-spi-2.x
>> would also be needed. There are many other utility classes that have never
>> been off limits for users to use.
>>
>> While your idea could work it definitely would impact some users.
>
>
> Note that LogManager has
>
> import org.apache.logging.log4j.simple.SimpleLoggerContextFactory;
> import org.apache.logging.log4j.spi.LoggerContext;
> import org.apache.logging.log4j.spi.LoggerContextFactory;
> import org.apache.logging.log4j.spi.LoggingSystem;
> import org.apache.logging.log4j.spi.Terminable;
> import org.apache.logging.log4j.status.StatusLogger;
> import org.apache.logging.log4j.util.StackLocatorUtil;
> import org.apache.logging.log4j.util.Strings;
>
> That would require users to have the SPI would it not?
And ThreadContext contains
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.apache.logging.log4j.spi.LoggingSystem;
import org.apache.logging.log4j.spi.LoggingSystemProperty;
import org.apache.logging.log4j.spi.ReadOnlyThreadContextMap;
import org.apache.logging.log4j.spi.ThreadContextMap;
import org.apache.logging.log4j.spi.ThreadContextStack;
import org.apache.logging.log4j.util.InternalApi;
import org.apache.logging.log4j.util.Strings;
I actually think your idea of splitting the API into API and SPI makes sense
but it doesn’t seem like it is going to be all that simple to do. The API will
have to only reference interfaces that are in the api and the spi would
implement them. I don’t know if that can be done without impacting users.
Ralph