Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Logging interceptor as Advice
public class LoggingAdvice {
public static void intercept(@Advice.BoxedArguments Object[] allArguments,
@Advice.Origin Method method) {
Logger logger = LoggerFactory.getLogger(method.getDeclaringClass());"Method {} of class {} called", method.getName(), method
for (Object argument : allArguments) {"Method {}, parameter type {}, value={}",
method.getName(), argument.getClass().getSimpleName(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment