abstract class AbstractTraceInterceptor : MethodInterceptor, Serializable
Base MethodInterceptor implementation for tracing.
By default, log messages are written to the log for the interceptor class, not the class which is being intercepted. Setting the useDynamicLogger bean property to true causes all log messages to be written to the Log for the target class being intercepted.
Subclasses must implement the invokeUnderTrace method, which is invoked by this class ONLY when a particular invocation SHOULD be traced. Subclasses should write to the Log instance provided.
Author
Rob Harrop
Author
Juergen Hoeller
Since
1.2
See Also
#setUseDynamicLogger#invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)
AbstractTraceInterceptor()
Base By default, log messages are written to the log for the interceptor class, not the class which is being intercepted. Setting the Subclasses must implement the |
open fun invoke(invocation: MethodInvocation): Any
Determines whether or not logging is enabled for the particular |
|
open fun setHideProxyClassNames(hideProxyClassNames: Boolean): Unit
Set to "true" to have |
|
open fun setLogExceptionStackTrace(logExceptionStackTrace: Boolean): Unit
Set whether to pass an exception to the logger, suggesting inclusion of its stack trace into the log. Default is "true"; set this to "false" in order to reduce the log output to just the trace message (which may include the exception class name and exception message, if applicable). |
|
open fun setLoggerName(loggerName: String): Unit
Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration. This can be specified to not log into the category of a class (whether this interceptor's class or the class getting called) but rather into a specific named category. NOTE: Specify either this property or "useDynamicLogger", not both. |
|
open fun setUseDynamicLogger(useDynamicLogger: Boolean): Unit
Set whether to use a dynamic logger or a static logger. Default is a static logger for this trace interceptor. Used to determine which NOTE: Specify either this property or "loggerName", not both. |
open class CustomizableTraceInterceptor : AbstractTraceInterceptor
Trace messages are written on method entry, and if the method invocation succeeds on method exit. If an invocation results in an exception, then an exception message is written. The contents of these trace messages is fully customizable and special placeholders are available to allow you to include runtime information in your log messages. The placeholders available are:
There are restrictions on which placeholders can be used in which messages: see the individual message properties for details on the valid placeholders. |