Package org.miaixz.bus.spring.env
Class LoggingEnvironmentPostProcessor
java.lang.Object
org.miaixz.bus.spring.env.LoggingEnvironmentPostProcessor
- All Implemented Interfaces:
org.springframework.boot.env.EnvironmentPostProcessor,org.springframework.core.Ordered
public class LoggingEnvironmentPostProcessor
extends Object
implements org.springframework.boot.env.EnvironmentPostProcessor, org.springframework.core.Ordered
通过
EnvironmentPostProcessor 实现日志配置检测,初始化等- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()static voidkeepCompatible(Map<String, String> context, boolean keep) 保持版本兼容,设置以下系统属性:void加载配置信息voidpostProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)
-
Constructor Details
-
LoggingEnvironmentPostProcessor
public LoggingEnvironmentPostProcessor()
-
-
Method Details
-
keepCompatible
保持版本兼容,设置以下系统属性:1、spring.output.ansi.enabled 2、logging.path 3、file.encoding 4、logging.pattern.console 5、logging.pattern.file
- Parameters:
context- 缓存信息keep- 是否跳过
-
postProcessEnvironment
public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application) - Specified by:
postProcessEnvironmentin interfaceorg.springframework.boot.env.EnvironmentPostProcessor
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
loadLogConfiguration
public void loadLogConfiguration(String key, String value, Map<String, String> context, String defaultValue) 加载配置信息- Parameters:
key- 属性Keyvalue- 属性Key对应值context- 缓存信息defaultValue- 默认值
-