search
HomeJavajavaTutorialWhat is the platform logging API in Java 9?

Java 9中的平台日志API是什么?

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!

Statement
This article is reproduced at:tutorialspoint. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function