In Java 9, PlatformLoggingAPI is available via Services Record messages The interface of the consumer of these messages. The implementation of LoggerFinder has been loaded using System ClassLoader with the help of java.util.ServiceLoader API . Based on this implementation, applications can plug in their own external logging backend without having to configure java.util.logging.
We can pass a class name or module to LoggerFinder so that it knows which logger to return.
<strong>public class MyLoggerFinder extends LoggerFinder { @Override public Logger getLogger(String name, Module module) { // return a logger depends on name/module } }</strong>
If no specific implementation is found, the default LoggerFinder implementation is used. We create the logger from the LoggerFinder by using the Factorymethod of the System class.
<strong>public class System { System.Logger getLogger(String name) { } System.Logger getLogger(String name, ResourceBundle bundle) { } }</strong>
The above is the detailed content of What is the platform logging API in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function