im.aop.loggers.advice.afterthrowing.LogAfterThrowing Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of im-aop-loggers Show documentation
Show all versions of im-aop-loggers Show documentation
A handy and configurable sets of annotation-based loggers for Spring Boot that can
log every execution of a method when entering or exiting normally or abnormally, without you
writing a single line of code using aspect-oriented programming (AOP)
The newest version!
package im.aop.loggers.advice.afterthrowing;
import im.aop.loggers.Level;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Log after leaving the target method by throwing an exception.
*
* @author Andy Lian
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
public @interface LogAfterThrowing {
/**
* @return Class name used as Logger's category name
*/
Class> declaringClass() default void.class;
/**
* @return Log Level for exited abnormally message
*/
Level level() default Level.DEFAULT;
/**
* @return Exited abnormally message template
*/
String exitedAbnormallyMessage() default "";
/**
* @return Exceptions that will be ignored by Logger
*/
Class extends Throwable>[] ignoreExceptions() default {};
/**
* @return Whether to print exception and its backtrace
*/
boolean printStackTrace() default true;
}