JEP 264: Platform Logging API and Service
Daniel Fuchs
daniel.fuchs at oracle.com
Tue Sep 29 18:40:44 UTC 2015
Hi Ralph,
On 20/09/15 07:54, Ralph Goers wrote:
> I do have some questions on this.
>
> Would anyone realistically be able to use SLF4J/Logback or Log4j 2 as the implementation? The logging implementation needs to be able to configure itself before logging can realistically be performed. If logging initialization happens too soon the application’s configuration may not be able to be located.
Bootstraping issues is one of the points that the implementation
of this JEP will need to address. We have already some experience
in that with java.util.logging and the s.u.l.PlatformLogger, but
it's possible that the provider of the concrete LoggerFinder
service implementation will need to play a role as well - depending
on the requirements of the underlying implementation it provides.
The logger returned by System.getLogger may not be directly
a logger obtained from the LoggerFinder service, but a wrapper
that will deal with possible bootstrap issue - for instance by
delaying the creation of the actual logger until such time where
it is actually used.
> Also, to do this would SLF4J/Logback or Log4j 2 have to be added to the boot classpath for them to be used for this?
I believe that the appropriate thing to do is to load
the implementation of the service with the ServiceLoader
from the System ClassLoader.
I also believe that a ServiceConfigurationError should be thrown
if more than one implementation of the service is found.
best regards,
-- daniel
>
> Ralph
>
>> On Sep 18, 2015, at 9:17 AM, mark.reinhold at oracle.com wrote:
>>
>> New JEP Candidate: http://openjdk.java.net/jeps/264
>>
>> - Mark
>>
>
>
More information about the core-libs-dev
mailing list