在Springboot中对AOP进行故障排除

发布于 2025-02-01 09:30:26 字数 517 浏览 2 评论 0原文

是否可以在Spring Boot上启用任何AOP诊断?我很难弄清楚我的哪个得分正在正确评估。例如,我有类似的东西,

@Pointcut("... ")
    public void foo() {
    }

@Pointcut("... ")
    public void bar() {
    }

@Around("foo() && bar()")
    public Object doSomething(final ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("*** do something");
        
    }

我的dosomething()方法没有被执行,我不知道为什么。显然,逻辑比这里只有2个点数要复杂得多。是否有某种诊断记录我可以向我展示每个对点的值?还是告诉我为什么dosomethig()是或未执行的?

Are there any AOP diagnostics that can be enabled on Spring Boot? I'm having trouble trying to figuring out which of my Pointcuts are evaluating correctly. For example, I have something like this

@Pointcut("... ")
    public void foo() {
    }

@Pointcut("... ")
    public void bar() {
    }

@Around("foo() && bar()")
    public Object doSomething(final ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("*** do something");
        
    }

My doSomething() method is not getting executed, and I can't figure out why. Obviously, the logic is a bit more complicateds than shown here with just 2 pointcuts. Is there some sort of diagnostic logging I ca enable that would show me that value of each of the pointcuts? Or something which tells me why doSomethig() is or is not executed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文