Adding logging for some of the configurable properties

This commit is contained in:
Sean McIlvenna
2019-02-11 17:21:32 -08:00
parent e752a99366
commit 4aaf6038cd

View File

@@ -24,22 +24,39 @@ import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
@EnableTransactionManagement() @EnableTransactionManagement()
public class FhirServerConfigCommon { public class FhirServerConfigCommon {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirServerConfigCommon.class);
/** /**
* Configure FHIR properties around the the JPA server via this bean * Configure FHIR properties around the the JPA server via this bean
*/ */
@Bean() @Bean()
public DaoConfig daoConfig() { public DaoConfig daoConfig() {
DaoConfig retVal = new DaoConfig(); DaoConfig retVal = new DaoConfig();
retVal.setAllowMultipleDelete(HapiProperties.getAllowMultipleDelete());
retVal.setAllowExternalReferences(HapiProperties.getAllowExternalReferences()); Boolean allowMultipleDelete = HapiProperties.getAllowMultipleDelete();
retVal.setExpungeEnabled(HapiProperties.getExpungeEnabled()); retVal.setAllowMultipleDelete(allowMultipleDelete);
retVal.setAutoCreatePlaceholderReferenceTargets(HapiProperties.getAllowPlaceholderReferences()); ourLog.info("Server configured to " + (allowMultipleDelete ? "allow" : "deny") + " multiple deletes");
Boolean allowExternalReferences = HapiProperties.getAllowExternalReferences();
retVal.setAllowExternalReferences(allowExternalReferences);
ourLog.info("Server configured to " + (allowExternalReferences ? "allow" : "deny") + " external references");
Boolean expungeEnabled = HapiProperties.getExpungeEnabled();
retVal.setExpungeEnabled(expungeEnabled);
ourLog.info("Server configured to " + (expungeEnabled ? "enable" : "disable") + " expunges");
Boolean allowPlaceholderReferences = HapiProperties.getAllowPlaceholderReferences();
retVal.setAutoCreatePlaceholderReferenceTargets(allowPlaceholderReferences);
ourLog.info("Server configured to " + (allowPlaceholderReferences ? "allow" : "deny") + " placeholder references");
// You can enable these if you want to support Subscriptions from your server // You can enable these if you want to support Subscriptions from your server
if (HapiProperties.getSubscriptionRestHookEnabled()) { if (HapiProperties.getSubscriptionRestHookEnabled()) {
ourLog.info("Enabling REST-hook subscriptions");
retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.RESTHOOK); retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.RESTHOOK);
} }
if (HapiProperties.getSubscriptionEmailEnabled()) { if (HapiProperties.getSubscriptionEmailEnabled()) {
ourLog.info("Enabling email subscriptions");
retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.EMAIL); retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.EMAIL);
} }