Skip to content

io microsphere logging jdk JavaLogging

github-actions[bot] edited this page May 21, 2026 · 6 revisions

JavaLogging

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

Source: microsphere-java-logging/src/main/java/io/microsphere/logging/jdk/JavaLogging.java

Overview

The Java Logging

Declaration

public class JavaLogging implements Logging

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.1.11-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

Method Examples

getRootLoggerName

JavaLogging logging = new JavaLogging();
  String rootName = logging.getRootLoggerName();
  // returns "" (empty string for the JDK root logger)

getLoggerNames

JavaLogging logging = new JavaLogging();
  List<String> names = logging.getLoggerNames();

getSupportedLoggingLevels

JavaLogging logging = new JavaLogging();
  Set<String> levels = logging.getSupportedLoggingLevels();
  // e.g. ["OFF", "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", "FINEST", "ALL"]

getLoggerLevel

JavaLogging logging = new JavaLogging();
  String level = logging.getLoggerLevel("io.microsphere"); // e.g. "INFO"

setLoggerLevel

JavaLogging logging = new JavaLogging();
  logging.setLoggerLevel("io.microsphere", "FINE");

getParentLoggerName

JavaLogging logging = new JavaLogging();
  String parentName = logging.getParentLoggerName("io.microsphere.logging");
  // returns "io.microsphere"

getName

JavaLogging logging = new JavaLogging();
  String name = logging.getName(); // "Java Logging"

getPriority

JavaLogging logging = new JavaLogging();
  int priority = logging.getPriority();
  // returns JavaLogging.PRIORITY

Usage

Maven Dependency

Add the following dependency to your pom.xml:

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

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

Import

import io.microsphere.logging.jdk.JavaLogging;

API Reference

Public Methods

Method Description
getRootLoggerName The root logger name : ""
getLoggerNames {@inheritDoc}
getSupportedLoggingLevels {@inheritDoc}
getLoggerLevel {@inheritDoc}
setLoggerLevel {@inheritDoc}
getParentLoggerName {@inheritDoc}
getName {@inheritDoc}
getPriority {@inheritDoc}

Method Details

getRootLoggerName

public String getRootLoggerName()

The root logger name : "" / public static final String ROOT_LOGGER_NAME = "";

/** The priority of JavaLogging / public static final int PRIORITY = NORMAL_PRIORITY + 10;

/** All Logging Levels : "OFF", "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", "FINEST", "ALL"

getLoggerNames

public List<String> getLoggerNames()

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  List names = logging.getLoggerNames();
`

getSupportedLoggingLevels

public Set<String> getSupportedLoggingLevels()

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  Set levels = logging.getSupportedLoggingLevels();
  // e.g. ["OFF", "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", "FINEST", "ALL"]
`

getLoggerLevel

public String getLoggerLevel(String loggerName)

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  String level = logging.getLoggerLevel("io.microsphere"); // e.g. "INFO"
`

setLoggerLevel

public void setLoggerLevel(String loggerName, String levelName)

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  logging.setLoggerLevel("io.microsphere", "FINE");
`

getParentLoggerName

public String getParentLoggerName(String loggerName)

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  String parentName = logging.getParentLoggerName("io.microsphere.logging");
  // returns "io.microsphere"
`

getName

public String getName()

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  String name = logging.getName(); // "Java Logging"
`

getPriority

public int getPriority()

{@inheritDoc}

Example Usage

`JavaLogging logging = new JavaLogging();
  int priority = logging.getPriority();
  // returns JavaLogging.PRIORITY
`

See Also

  • Logging
  • LoggingMXBean

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

Clone this wiki locally