mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-17 17:52:28 +02:00
debugs
This commit is contained in:
parent
73ac17942f
commit
faecaf1ee4
@ -80,6 +80,7 @@ public class SPdfApplication {
|
|||||||
app.addInitializers(new ConfigInitializer());
|
app.addInitializers(new ConfigInitializer());
|
||||||
Map<String, String> propertyFiles = new HashMap<>();
|
Map<String, String> propertyFiles = new HashMap<>();
|
||||||
// External config files
|
// External config files
|
||||||
|
log.info("Settings file: {}", InstallationPathConfig.getSettingsPath());
|
||||||
if (Files.exists(Paths.get(InstallationPathConfig.getSettingsPath()))) {
|
if (Files.exists(Paths.get(InstallationPathConfig.getSettingsPath()))) {
|
||||||
propertyFiles.put(
|
propertyFiles.put(
|
||||||
"spring.config.additional-location",
|
"spring.config.additional-location",
|
||||||
|
@ -9,17 +9,27 @@ import org.springframework.core.env.PropertySource;
|
|||||||
import org.springframework.core.io.support.EncodedResource;
|
import org.springframework.core.io.support.EncodedResource;
|
||||||
import org.springframework.core.io.support.PropertySourceFactory;
|
import org.springframework.core.io.support.PropertySourceFactory;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@Slf4j
|
||||||
public class YamlPropertySourceFactory implements PropertySourceFactory {
|
public class YamlPropertySourceFactory implements PropertySourceFactory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PropertySource<?> createPropertySource(String name, EncodedResource encodedResource)
|
public PropertySource<?> createPropertySource(String name, EncodedResource encodedResource)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
|
YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
|
||||||
factory.setResources(encodedResource.getResource());
|
factory.setResources(encodedResource.getResource());
|
||||||
|
Properties properties = factory.getObject();
|
||||||
|
|
||||||
Properties properties = factory.getObject();
|
// Add debug logging
|
||||||
|
if (properties != null) {
|
||||||
|
log.info("Loaded properties count: {}", properties.size());
|
||||||
|
properties.forEach((key, value) ->
|
||||||
|
log.info("Property loaded - Key: {}, Value: {}", key, value));
|
||||||
|
} else {
|
||||||
|
log.warn("No properties loaded from resource");
|
||||||
|
}
|
||||||
|
|
||||||
return new PropertiesPropertySource(
|
return new PropertiesPropertySource(
|
||||||
encodedResource.getResource().getFilename(), properties);
|
encodedResource.getResource().getFilename(), properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
@ -40,6 +41,7 @@ import stirling.software.SPDF.model.provider.UnsupportedProviderException;
|
|||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConfigurationProperties(prefix = "")
|
@ConfigurationProperties(prefix = "")
|
||||||
|
@EnableConfigurationProperties(ApplicationProperties.class)
|
||||||
@Data
|
@Data
|
||||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -65,6 +67,9 @@ public class ApplicationProperties {
|
|||||||
PropertySource<?> propertySource =
|
PropertySource<?> propertySource =
|
||||||
new YamlPropertySourceFactory().createPropertySource(null, encodedResource);
|
new YamlPropertySourceFactory().createPropertySource(null, encodedResource);
|
||||||
environment.getPropertySources().addFirst(propertySource);
|
environment.getPropertySources().addFirst(propertySource);
|
||||||
|
|
||||||
|
log.info("Loaded properties: " + propertySource.getSource());
|
||||||
|
|
||||||
return propertySource;
|
return propertySource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user