Skip to content

io microsphere logging JDKLoggerFactory

github-actions[bot] edited this page Mar 24, 2026 · 3 revisions

JDKLoggerFactory

Type: Class | Module: microsphere-java-core | Package: io.microsphere.logging | Since: 1.0.0

Source: microsphere-java-core/src/main/java/io/microsphere/logging/JDKLoggerFactory.java

Overview

A LoggerFactory implementation that creates and manages instances of JDK logging (java.util.logging.Logger).

This factory provides a concrete implementation for creating JDK-based loggers with the required name. It defines priority-based ordering by implementing the Prioritized interface, ensuring proper loading order when multiple logger factories are present.

Example Usage

The typical usage involves relying on the static methods provided by the base class:

`// Get a logger instance associated with a specific class
Logger logger = getLogger(MyClass.class);

// Get a named logger instance
Logger namedLogger = getLogger("com.example.mylogger");
`

The factory is automatically loaded via the ServiceLoader mechanism if registered properly in the configuration files.

Declaration

public class JDKLoggerFactory extends LoggerFactory

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.2-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 8 ✅ Compatible
Java 11 ✅ Compatible
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

// Get a logger instance associated with a specific class
Logger logger = getLogger(MyClass.class);

// Get a named logger instance
Logger namedLogger = getLogger("com.example.mylogger");

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-java-core</artifactId>
    <version>${microsphere-java.version}</version>
</dependency>

Tip: Use the BOM (microsphere-java-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.logging.JDKLoggerFactory;

API Reference

Public Methods

Method Description
createLogger
getPriority
isTraceEnabled
trace
trace
isDebugEnabled
debug
debug
isInfoEnabled
info
info
isWarnEnabled
warn
warn
isErrorEnabled
error
error

See Also

  • LoggerFactory
  • java.util.logging.Logger

This documentation was auto-generated from the source code of microsphere-java.

Home

annotation-processor

java-annotations

java-core

java-test

jdk-tools

lang-model

Clone this wiki locally