
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
What is Platform Logging API in Java 9?
In Java 9, Platform Logging API can be used to log messages with a service interface for consumers of those messages. An implementation of LoggerFinder has been loaded with the help of java.util.ServiceLoader API by using System ClassLoader. Based on this implementation, an application can plug in its own external logging backend without configuring java.util.logging.
We can pass a class name or module to LoggerFinder so that it knows which logger to return.
public class MyLoggerFinder extends LoggerFinder { @Override public Logger getLogger(String name, Module module) { // return a logger depends on name/module } }
If no concrete implementation can be found, then a default LoggerFinder implementation has been used. We obtain loggers that have created from LoggerFinder by using factory methods of the System class.
public class System { System.Logger getLogger(String name) { } System.Logger getLogger(String name, ResourceBundle bundle) { } }
- Related Articles
- What is Unified JVM Logging in Java 9?
- StackWalker API in Java 9?
- What are the improvements in Process API in Java 9?
- What are the CompletableFuture API improvements in Java 9?\n
- What are the steps to execute Flow API in Java 9?
- What are the core library changes in Process API in Java 9?
- What are the new features added to Stream API in Java 9?
- What are the new methods added to Process API in Java 9?
- What is meant by Java being platform-independent?
- What is Java API and what is its use?
- How is Java platform independent?
- How to print all attributes in StackFrame API in Java 9?
- How to implement reactive streams using Flow API in Java 9?
- Importance of iterate() method of Stream API in Java 9?\n
- How to filter stack frames using StackWalker API in Java 9?

Advertisements