Package org.springframework.core.log
Class LogAccessor
java.lang.Object
org.springframework.core.log.LogAccessor
A convenient accessor for Commons Logging, providing not only
CharSequence based log methods but also Supplier
based variants for use with Java 8 lambda expressions.- Since:
- 5.2
- Author:
- Juergen Hoeller
-
Constructor Summary
ConstructorsConstructorDescriptionLogAccessor(Class<?> logCategory) Create a new accessor for the specified Commons Log category.LogAccessor(String logCategory) Create a new accessor for the specified Commons Log category.LogAccessor(Log log) Create a new accessor for the given Commons Log. -
Method Summary
Modifier and TypeMethodDescriptionvoiddebug(CharSequence message) Log a message with debug log level.voiddebug(Throwable cause, CharSequence message) Log an error with debug log level.voiddebug(Throwable cause, Supplier<? extends CharSequence> messageSupplier) Log an error with debug log level.voiddebug(Supplier<? extends CharSequence> messageSupplier) Log a message with debug log level.voiderror(CharSequence message) Log a message with error log level.voiderror(Throwable cause, CharSequence message) Log an error with error log level.voiderror(Throwable cause, Supplier<? extends CharSequence> messageSupplier) Log an error with error log level.voiderror(Supplier<? extends CharSequence> messageSupplier) Log a message with error log level.voidfatal(CharSequence message) Log a message with fatal log level.voidfatal(Throwable cause, CharSequence message) Log an error with fatal log level.voidfatal(Throwable cause, Supplier<? extends CharSequence> messageSupplier) Log an error with fatal log level.voidfatal(Supplier<? extends CharSequence> messageSupplier) Log a message with fatal log level.final LoggetLog()Return the target Commons Log.voidinfo(CharSequence message) Log a message with info log level.voidinfo(Throwable cause, CharSequence message) Log an error with info log level.voidinfo(Throwable cause, Supplier<? extends CharSequence> messageSupplier) Log an error with info log level.voidinfo(Supplier<? extends CharSequence> messageSupplier) Log a message with info log level.booleanIs debug logging currently enabled?booleanIs error logging currently enabled?booleanIs fatal logging currently enabled?booleanIs info logging currently enabled?booleanIs trace logging currently enabled?booleanIs warn logging currently enabled?voidtrace(CharSequence message) Log a message with trace log level.voidtrace(Throwable cause, CharSequence message) Log an error with trace log level.voidtrace(Throwable cause, Supplier<? extends CharSequence> messageSupplier) Log an error with trace log level.voidtrace(Supplier<? extends CharSequence> messageSupplier) Log a message with trace log level.voidwarn(CharSequence message) Log a message with warn log level.voidwarn(Throwable cause, CharSequence message) Log an error with warn log level.voidwarn(Throwable cause, Supplier<? extends CharSequence> messageSupplier) Log an error with warn log level.voidwarn(Supplier<? extends CharSequence> messageSupplier) Log a message with warn log level.
-
Constructor Details
-
LogAccessor
Create a new accessor for the given Commons Log. -
LogAccessor
Create a new accessor for the specified Commons Log category.- See Also:
-
LogAccessor
Create a new accessor for the specified Commons Log category.- See Also:
-
-
Method Details
-
getLog
Return the target Commons Log. -
isFatalEnabled
public boolean isFatalEnabled()Is fatal logging currently enabled? -
isErrorEnabled
public boolean isErrorEnabled()Is error logging currently enabled? -
isWarnEnabled
public boolean isWarnEnabled()Is warn logging currently enabled? -
isInfoEnabled
public boolean isInfoEnabled()Is info logging currently enabled? -
isDebugEnabled
public boolean isDebugEnabled()Is debug logging currently enabled? -
isTraceEnabled
public boolean isTraceEnabled()Is trace logging currently enabled? -
fatal
Log a message with fatal log level.- Parameters:
message- the message to log
-
fatal
Log an error with fatal log level.- Parameters:
cause- the exception to logmessage- the message to log
-
error
Log a message with error log level.- Parameters:
message- the message to log
-
error
Log an error with error log level.- Parameters:
cause- the exception to logmessage- the message to log
-
warn
Log a message with warn log level.- Parameters:
message- the message to log
-
warn
Log an error with warn log level.- Parameters:
cause- the exception to logmessage- the message to log
-
info
Log a message with info log level.- Parameters:
message- the message to log
-
info
Log an error with info log level.- Parameters:
cause- the exception to logmessage- the message to log
-
debug
Log a message with debug log level.- Parameters:
message- the message to log
-
debug
Log an error with debug log level.- Parameters:
cause- the exception to logmessage- the message to log
-
trace
Log a message with trace log level.- Parameters:
message- the message to log
-
trace
Log an error with trace log level.- Parameters:
cause- the exception to logmessage- the message to log
-
fatal
Log a message with fatal log level.- Parameters:
messageSupplier- a lazy supplier for the message to log
-
fatal
Log an error with fatal log level.- Parameters:
cause- the exception to logmessageSupplier- a lazy supplier for the message to log
-
error
Log a message with error log level.- Parameters:
messageSupplier- a lazy supplier for the message to log
-
error
Log an error with error log level.- Parameters:
cause- the exception to logmessageSupplier- a lazy supplier for the message to log
-
warn
Log a message with warn log level.- Parameters:
messageSupplier- a lazy supplier for the message to log
-
warn
Log an error with warn log level.- Parameters:
cause- the exception to logmessageSupplier- a lazy supplier for the message to log
-
info
Log a message with info log level.- Parameters:
messageSupplier- a lazy supplier for the message to log
-
info
Log an error with info log level.- Parameters:
cause- the exception to logmessageSupplier- a lazy supplier for the message to log
-
debug
Log a message with debug log level.- Parameters:
messageSupplier- a lazy supplier for the message to log
-
debug
Log an error with debug log level.- Parameters:
cause- the exception to logmessageSupplier- a lazy supplier for the message to log
-
trace
Log a message with trace log level.- Parameters:
messageSupplier- a lazy supplier for the message to log
-
trace
Log an error with trace log level.- Parameters:
cause- the exception to logmessageSupplier- a lazy supplier for the message to log
-