feat(): 监听
parent
ec420b030f
commit
e72130653d
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.cloud.pay;
|
||||||
|
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.boot.ConfigurableBootstrapContext;
|
||||||
|
import org.springframework.boot.SpringApplicationRunListener;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
import org.springframework.core.env.ConfigurableEnvironment;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: DongZeLiang
|
||||||
|
* @date: 2024/8/3
|
||||||
|
* @Description:
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
public class MySpringApplicationRunlistener implements SpringApplicationRunListener {
|
||||||
|
public MySpringApplicationRunlistener () {
|
||||||
|
log.info("MySpringApplicationRunlistener");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void starting (ConfigurableBootstrapContext bootstrapContext) {
|
||||||
|
log.info("执行:{}", "starting");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void environmentPrepared (ConfigurableBootstrapContext bootstrapContext, ConfigurableEnvironment environment) {
|
||||||
|
log.info("执行:{}", "environmentPrepared");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void contextPrepared (ConfigurableApplicationContext context) {
|
||||||
|
log.info("执行:{}", "contextPrepared");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void contextLoaded (ConfigurableApplicationContext context) {
|
||||||
|
log.info("执行:{}", "contextLoaded");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void started (ConfigurableApplicationContext context, Duration timeTaken) {
|
||||||
|
log.info("执行:{}", "started");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ready (ConfigurableApplicationContext context, Duration timeTaken) {
|
||||||
|
log.info("执行:{}", "ready");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void failed (ConfigurableApplicationContext context, Throwable exception) {
|
||||||
|
log.info("执行:{}", "failed");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue