Class StaticLoggerBinder

java.lang.Object
org.slf4j.impl.StaticLoggerBinder
All Implemented Interfaces:
org.slf4j.spi.LoggerFactoryBinder

public final class StaticLoggerBinder extends Object implements org.slf4j.spi.LoggerFactoryBinder
StaticLoggerBinder shim for SLF4J 1.x legacy support.

This class acts as a fake stand-in implementation of org.slf4j.impl.StaticLoggerBinder so that SLF4J 2.x may be used even with applications that rely on StaticLoggerBinder. For such applications, simply include this library as a dependency; no further changes are needed.

This library may be used standalone to provide legacy SLF4J 1.x support to any application. It does not rely on Clogr; indeed the Clogr API must be added as a separate dependency.

Author:
Garret Wilson
API Note:
This library uses the org.slf4j.impl package, which represents a domain controlled by another entity. Normally this is against convention, but in this case it is necessary, as some legacy access requires that particular class to be present in that particular package. Moreover this usage will likely break Java module support when used with actual the SLF4J API distribution; however applications that rely on SLF4J 1.x `StaticLoggerBinder` would break the module system anyway. This implementation is being supplied merely as a stop-gap solution until applications remove their reliance on legacy SLF4J 1.x features.
Implementation Specification:
This implementation merely delegates to LoggerFactory.getILoggerFactory(), thereby relying on the ServiceLoader mechanism of SLF4J 2.x.
Implementation Note:
This implementation was independently created to adhere to the basic API and minimal functional requirements of the original SLF4J 1.x org.slf4j.impl.StaticLoggerBinder by Ceki Gülcü, Copyright (c) 2004-2011 QOS.ch.
See Also:
  • Method Details

    • getSingleton

      public static StaticLoggerBinder getSingleton()
      Returns:
      The singleton instance of this class.
    • getLoggerFactory

      public org.slf4j.ILoggerFactory getLoggerFactory()
      Specified by:
      getLoggerFactory in interface org.slf4j.spi.LoggerFactoryBinder
      Implementation Specification:
      This implementation delegates to LoggerFactory.getILoggerFactory().
    • getLoggerFactoryClassStr

      public String getLoggerFactoryClassStr()
      Specified by:
      getLoggerFactoryClassStr in interface org.slf4j.spi.LoggerFactoryBinder
      Implementation Specification:
      This implementation returns the name of the class of the logger factor instance returned by getLoggerFactory().