【问题标题】:can we do AOP logging for class which is not annotated with spring annotation我们可以为未使用 spring 注释的类进行 AOP 日志记录吗
【发布时间】:2022-01-17 20:04:22
【问题描述】:

我想为这门课做 AspectJ 日志记录,任何人都可以向我建议如何做,甚至有可能吗?

public class Class{
  public void method(){
    // code
  }
}

【问题讨论】:

  • 是Spring管理的Bean吗?
  • 没有 Dias,它的常规 java 类

标签: spring spring-boot spring-aop java.util.logging spring-logback


【解决方案1】:

不,Spring AOP 只会处理 Spring 管理的 Bean。

【讨论】:

    猜你喜欢
    • 2012-11-04
    • 1970-01-01
    • 2018-04-13
    • 1970-01-01
    • 2015-08-18
    • 1970-01-01
    • 2012-09-30
    • 2011-04-05
    • 2013-03-22
    相关资源
    最近更新 更多