Skip to content

Commit

Permalink
add sentry configuration (#38)
Browse files Browse the repository at this point in the history
* add sentry configuration

* bump snapshot version
  • Loading branch information
bennsimon authored Apr 4, 2022
1 parent 76d53a2 commit fd0761a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<artifactId>hapi-fhir-jpaserver-starter</artifactId>
<groupId>org.smartregister</groupId>
<version>5.7.0-SNAPSHOT</version>
<version>5.8.0-SNAPSHOT</version>

<properties>
<java.version>8</java.version>
Expand Down Expand Up @@ -159,6 +159,12 @@
<version>0.0.4-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.smartregister.hapi-fhir-opensrp-extensions</groupId>
<artifactId>configuration</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<!-- HAPI-FHIR uses Logback for logging support. The logback library is included automatically by Maven as a part of the hapi-fhir-base dependency, but you also need to include a logging library. Logback
is used here, but log4j would also be fine. -->
<dependency>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ca/uhn/fhir/jpa/starter/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig;
import ca.uhn.fhir.jpa.subscription.match.config.WebsocketDispatcherConfig;
import ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig;
import org.smartregister.extension.configuration.OpenSRPExtensionConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.boot.SpringApplication;
Expand All @@ -26,7 +27,7 @@
@ServletComponentScan(basePackageClasses = {
JpaRestfulServer.class})
@SpringBootApplication(exclude = {ElasticsearchRestClientAutoConfiguration.class})
@Import({SubscriptionSubmitterConfig.class, SubscriptionProcessorConfig.class, SubscriptionChannelConfig.class, WebsocketDispatcherConfig.class, MdmConfig.class})
@Import({SubscriptionSubmitterConfig.class, SubscriptionProcessorConfig.class, SubscriptionChannelConfig.class, WebsocketDispatcherConfig.class, MdmConfig.class, OpenSRPExtensionConfiguration.class})
@EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class})
public class Application extends SpringBootServletInitializer {

Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,14 @@ keycloak:
# use-resource-role-mappings: true,
logging.level.org.springframework.web: trace
logging.level.org.apache: trace

#sentry:
# enabled: false
# options:
# dsn:
# release:
# environment:
# tags:
# debug: false
# minimumEventLevel: ERROR
# minimumBreadcrumbLevel: INFO
11 changes: 11 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
<appender-ref ref="STDOUT" />
</logger>

<!-- Start Sentry Appender Configuration -->
<!-- Sentry appender disabled by default, to enable set sentry.enabled property to true on the application.yaml-->
<springProperty name="sentry.enabled" source="sentry.enabled" />
<property name="sentry.appender.enabled" value="${sentry.enabled}" />
<if condition='property("sentry.appender.enabled").equals("true")'>
<then>
<include optional="true" resource="sentry-logback.xml" />
</then>
</if>
<!-- End Sentry Appender Configuration -->

<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
Expand Down

0 comments on commit fd0761a

Please sign in to comment.