1.注册日志的类:

@Configuration
@EnableReactor
public class ReactorConfig {
/**
*
* 〈注册审计日志 Reactor〉
*/
@Bean(name = "sysLog")
public Reactor sysLogReactor(Environment env) {
return Reactors.reactor().env(env).get();

}

}

2.声明记录日志的类和方法:

@Component
public class LogOperationHandler {

@Selector(value = "sysLog", reactor = "@sysLog")
public void handleSysLog(Event<Object> evt) {}

}

3.使用该方法:

// 系统日志
@Autowired
@Qualifier("sysLog")
private Reactor sysLog;

sysLog.notify("sysLog", Event.wrap(baseElement));//通知reactor保存到数据库中

相关文章:

  • 2021-12-13
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2021-08-22
  • 2022-02-05
猜你喜欢
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
相关资源
相似解决方案