Skip to content

Commit

Permalink
💻 add property source init log
Browse files Browse the repository at this point in the history
  • Loading branch information
yuebaix committed Sep 4, 2021
1 parent 70f126c commit be5534c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.yuebaix.pangu.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

@Slf4j
public class PanGuPropertySourceContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
public void initialize(ConfigurableApplicationContext context) {
ConfigurableEnvironment environment = context.getEnvironment();
if (!environment.getPropertySources().contains(PanGuPropertySource.PROPERTY_SOURCE_NAME)) {
environment.getPropertySources().addLast(new PanGuPropertySource());
log.info(this.getClass().getSimpleName() + "--->PropertySource Initialized");
}
}
}

0 comments on commit be5534c

Please sign in to comment.