public class LoggerFactory extends Object
Logger
instances. It uses reflection to see what logging backends are available on the
classpath and tries to find the most appropriate one.
From SimpleLogging: https://github.com/j256/simplelogging
To set the logger to a particular type, set the system property ("com.j256.simplelogger.backend") contained in
LOG_TYPE_SYSTEM_PROPERTY
to be name of one of the enumerated types in LogBackendType
. You can also
call setLogBackendType(LogBackendType)
or setLogBackendFactory(LogBackendFactory)
.
Modifier and Type | Field and Description |
---|---|
static String |
LOG_TYPE_SYSTEM_PROPERTY |
Modifier and Type | Method and Description |
---|---|
static LogBackendFactory |
getLogBackendFactory()
Get the currently assigned log factory or null if none.
|
static Logger |
getLogger(Class<?> clazz)
Return a logger associated with a particular class.
|
static Logger |
getLogger(String className)
Return a logger associated with a particular class name.
|
static String |
getSimpleClassName(String className)
Return the single class name from a class-name string.
|
static void |
setLogBackendFactory(LogBackendFactory LogBackendFactory)
Set the log backend factory to be a specific instance.
|
static void |
setLogBackendType(LogBackendType type)
Set the log backend type to be a specific enum type.
|
public static final String LOG_TYPE_SYSTEM_PROPERTY
public static Logger getLogger(Class<?> clazz)
public static Logger getLogger(String className)
public static LogBackendFactory getLogBackendFactory()
public static void setLogBackendFactory(LogBackendFactory LogBackendFactory)
LogBackendFactory
implementation.public static void setLogBackendType(LogBackendType type)
IllegalArgumentException
- If the logging type is not available, most likely because classes are missing from the classpath.This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.