Package io.microsphere.logging
Class ACLLoggerFactory
- java.lang.Object
-
- io.microsphere.logging.LoggerFactory
-
- io.microsphere.logging.ACLLoggerFactory
-
- All Implemented Interfaces:
Prioritized
,java.lang.Comparable<Prioritized>
public class ACLLoggerFactory extends LoggerFactory
LoggerFactory
implementation for Apache Commons Logging (ACL).ACLLoggerFactory
provides a bridge to the Apache Commons Logging framework, creating and managing instances of theLogger
interface backed by ACL'sLog
.Example Usage
Normally, this factory is automatically discovered and used when Apache Commons Logging is present on the classpath. However, it can also be explicitly set as the logging provider:// Explicitly setting ACLLoggerFactory as the logging provider LoggerFactory factory = new ACLLoggerFactory(); Logger logger = factory.createLogger("com.example.MyClass"); logger.info("This is an info message.");
Integration with Prioritized Interface
This factory has a defined priority level (getPriority()
) that determines its precedence among other available logging frameworks. The higher the number, the lower the priority.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
LoggerFactory
,Log
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACL_LOG_CLASS_NAME
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ACLLoggerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Logger
createLogger(java.lang.String name)
Create a newLogger
protected java.lang.String
getDelegateLoggerClassName()
The class name of delegate Loggerint
getPriority()
Get the priority-
Methods inherited from class io.microsphere.logging.LoggerFactory
getLogger, getLogger, isAvailable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo
-
-
-
-
Field Detail
-
ACL_LOG_CLASS_NAME
public static final java.lang.String ACL_LOG_CLASS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDelegateLoggerClassName
protected java.lang.String getDelegateLoggerClassName()
Description copied from class:LoggerFactory
The class name of delegate Logger- Specified by:
getDelegateLoggerClassName
in classLoggerFactory
- Returns:
- non-null
-
createLogger
public Logger createLogger(java.lang.String name)
Description copied from class:LoggerFactory
Create a newLogger
- Specified by:
createLogger
in classLoggerFactory
- Parameters:
name
- the name ofLogger
- Returns:
- non-null
-
getPriority
public int getPriority()
Description copied from interface:Prioritized
Get the priority- Returns:
- the default is
minimum one
-
-