public class LoggerFactory extends Object
LoggerFactory, providing additional utility methods for creating and managing
loggers.
This class is final and cannot be instantiated.
| Constructor and Description |
|---|
LoggerFactory() |
| Modifier and Type | Method and Description |
|---|---|
OutputStream |
getDebugOutputStream(@NonNull org.slf4j.Logger logger)
Returns a
OutputStream that writes debug-level messages to the specified logger. |
PrintStream |
getDebugPrintStream(@NonNull org.slf4j.Logger logger)
Returns a
PrintStream that writes structured text as debug-level messages to the specified logger. |
OutputStream |
getErrorOutputStream(@NonNull org.slf4j.Logger logger)
Returns a
OutputStream that writes error-level messages to the specified logger. |
PrintStream |
getErrorPrintStream(@NonNull org.slf4j.Logger logger)
Returns a
PrintStream that writes structured text as error-level messages to the specified logger. |
OutputStream |
getInfoOutputStream(@NonNull org.slf4j.Logger logger)
Returns a
OutputStream that writes info-level messages to the specified logger. |
PrintStream |
getInfoPrintStream(@NonNull org.slf4j.Logger logger)
Returns a
PrintStream that writes structured text as info-level messages to the specified logger. |
org.slf4j.Logger |
getLogger(@NonNull Class<?> clazz)
Retrieves a logger named after the specified class using the statically
bound
ILoggerFactory instance. |
org.slf4j.Logger |
getLogger(@NonNull Class<?> clazz,
@NonNull String name)
Retrieves a logger named after a parent class and a specific operation
or feature, using the statically bound
ILoggerFactory instance. |
org.slf4j.Logger |
getLogger(@NonNull org.slf4j.Logger logger,
@NonNull String name)
Retrieves a logger named after a parent logger and a specific operation
or feature, using the statically bound
ILoggerFactory instance. |
org.slf4j.Logger |
getLogger(@NonNull String name)
Retrieves a logger with the specified name using the statically bound
ILoggerFactory instance. |
OutputStream |
getTraceOutputStream(@NonNull org.slf4j.Logger logger)
Returns a
OutputStream that writes trace-level messages to the specified logger. |
PrintStream |
getTracePrintStream(@NonNull org.slf4j.Logger logger)
Returns a
PrintStream that writes structured text as trace-level messages to the specified logger. |
OutputStream |
getWarnOutputStream(@NonNull org.slf4j.Logger logger)
Returns a
OutputStream that writes warn-level messages to the specified logger. |
PrintStream |
getWarnPrintStream(@NonNull org.slf4j.Logger logger)
Returns a
PrintStream that writes structured text as warn-level messages to the specified logger. |
public org.slf4j.Logger getLogger(@NonNull
@NonNull String name)
ILoggerFactory instance.
This is recommended for obtaining a logger with a custom name that does not follow the fully qualified class name convention.
name - the name of the loggerpublic org.slf4j.Logger getLogger(@NonNull
@NonNull Class<?> clazz)
ILoggerFactory instance.
This is recommended for obtaining a logger that tracks features provided by the specified class.
clazz - the class whose name will be used for the loggerpublic org.slf4j.Logger getLogger(@NonNull
@NonNull Class<?> clazz,
@NonNull
@NonNull String name)
ILoggerFactory instance.
This is recommended for obtaining a logger that is subordinate to an existing logger named after a class.
clazz - the parent class whose name will be used as a basename - the name of the operation or feature appended to the parent logger namepublic org.slf4j.Logger getLogger(@NonNull
@NonNull org.slf4j.Logger logger,
@NonNull
@NonNull String name)
ILoggerFactory instance.
This is recommended for obtaining a logger that is subordinate to an existing logger.
logger - the parent loggername - the name of the operation or feature appended to the parent logger namepublic PrintStream getTracePrintStream(@NonNull @NonNull org.slf4j.Logger logger)
PrintStream that writes structured text as trace-level messages to the specified logger.
The close method of the returned PrintStream triggers the logging of the
accumulated text.
logger - the logger to which messages will be writtenpublic PrintStream getDebugPrintStream(@NonNull @NonNull org.slf4j.Logger logger)
PrintStream that writes structured text as debug-level messages to the specified logger.
The close method of the returned PrintStream triggers the logging of the
accumulated text.
logger - the logger to which messages will be writtenpublic PrintStream getInfoPrintStream(@NonNull @NonNull org.slf4j.Logger logger)
PrintStream that writes structured text as info-level messages to the specified logger.
The close method of the returned PrintStream triggers the logging of the
accumulated text.
logger - the logger to which messages will be writtenpublic PrintStream getWarnPrintStream(@NonNull @NonNull org.slf4j.Logger logger)
PrintStream that writes structured text as warn-level messages to the specified logger.
The close method of the returned PrintStream triggerss the logging of the
accumulated text.
logger - the logger to which messages will be writtenpublic PrintStream getErrorPrintStream(@NonNull @NonNull org.slf4j.Logger logger)
PrintStream that writes structured text as error-level messages to the specified logger.
The close method of the returned PrintStream triggerss the logging of the
accumulated text.
logger - the logger to which messages will be writtenpublic OutputStream getTraceOutputStream(@NonNull @NonNull org.slf4j.Logger logger)
OutputStream that writes trace-level messages to the specified logger.
The close method of the returned OutputStream triggerss the logging of the
accumulated bytes.
logger - the logger to which messages will be writtenpublic OutputStream getDebugOutputStream(@NonNull @NonNull org.slf4j.Logger logger)
OutputStream that writes debug-level messages to the specified logger.
The close method of the returned OutputStream triggerss the logging of the
accumulated bytes.
logger - the logger to which messages will be writtenpublic OutputStream getInfoOutputStream(@NonNull @NonNull org.slf4j.Logger logger)
OutputStream that writes info-level messages to the specified logger.
The close method of the returned OutputStream triggerss the logging of the
accumulated bytes.
logger - the logger to which messages will be writtenpublic OutputStream getWarnOutputStream(@NonNull @NonNull org.slf4j.Logger logger)
OutputStream that writes warn-level messages to the specified logger.
The close method of the returned OutputStream triggerss the logging of the
accumulated bytes.
logger - the logger to which messages will be writtenpublic OutputStream getErrorOutputStream(@NonNull @NonNull org.slf4j.Logger logger)
OutputStream that writes error-level messages to the specified logger.
The close method of the returned OutputStream triggerss the logging of the
accumulated bytes.
logger - the logger to which messages will be writtenCopyright © 2010–2025. All rights reserved.