|
34 | 34 | import org.springframework.context.annotation.Configuration; |
35 | 35 | import org.springframework.context.annotation.Import; |
36 | 36 | import org.springframework.scheduling.annotation.EnableAsync; |
| 37 | +import org.springframework.util.ObjectUtils; |
| 38 | + |
| 39 | +import java.util.List; |
37 | 40 |
|
38 | 41 | import static org.minbox.framework.api.boot.autoconfigure.logging.ApiBootLoggingProperties.API_BOOT_LOGGING_PREFIX; |
39 | 42 |
|
@@ -79,14 +82,20 @@ public ApiBootLoggingAutoConfiguration(ApiBootLoggingProperties apiBootLoggingPr |
79 | 82 | */ |
80 | 83 | @Bean |
81 | 84 | @ConditionalOnMissingBean |
82 | | - public LoggingFactoryBean loggingFactoryBean(ObjectProvider<LoggingAdminDiscovery> loggingAdminDiscoveryObjectProvider) { |
| 85 | + public LoggingFactoryBean loggingFactoryBean(ObjectProvider<LoggingAdminDiscovery> loggingAdminDiscoveryObjectProvider, |
| 86 | + ObjectProvider<List<LoggingFactoryBeanCustomizer>> customizerObjectProvider) { |
83 | 87 | LoggingFactoryBean factoryBean = new LoggingFactoryBean(); |
84 | 88 | factoryBean.setIgnorePaths(apiBootLoggingProperties.getIgnorePaths()); |
85 | 89 | factoryBean.setReportAway(apiBootLoggingProperties.getReportAway()); |
86 | 90 | factoryBean.setNumberOfRequestLog(apiBootLoggingProperties.getReportNumberOfRequestLog()); |
87 | 91 | factoryBean.setReportInitialDelaySecond(apiBootLoggingProperties.getReportInitialDelaySecond()); |
88 | 92 | factoryBean.setReportIntervalSecond(apiBootLoggingProperties.getReportIntervalSecond()); |
89 | 93 | factoryBean.setLoggingAdminDiscovery(loggingAdminDiscoveryObjectProvider.getIfAvailable()); |
| 94 | + |
| 95 | + List<LoggingFactoryBeanCustomizer> customizers = customizerObjectProvider.getIfAvailable(); |
| 96 | + if (!ObjectUtils.isEmpty(customizers)) { |
| 97 | + customizers.stream().forEach(customizer -> customizer.customize(factoryBean)); |
| 98 | + } |
90 | 99 | return factoryBean; |
91 | 100 | } |
92 | 101 |
|
@@ -161,7 +170,7 @@ public LoggingAdminNotice loggingAdminNotice(LoggingFactoryBean factoryBean) { |
161 | 170 | * Logging Report Scheduled Task Job |
162 | 171 | * When the configuration parameter "api.boot.logging.report-away=timing" is configured, |
163 | 172 | * the creation timing task is performed to report log information to admin node |
164 | | - * {@link ApiBootLoggingProperties#getReportAway} |
| 173 | + * {@link ApiBootLoggingProperties} |
165 | 174 | * {@link LoggingReportScheduled} |
166 | 175 | * |
167 | 176 | * @param factoryBean logging factory bean |
|
0 commit comments