Skip to content

Commit fd0761a

Browse files
authored
add sentry configuration (#38)
* add sentry configuration * bump snapshot version
1 parent 76d53a2 commit fd0761a

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
2121
<groupId>org.smartregister</groupId>
22-
<version>5.7.0-SNAPSHOT</version>
22+
<version>5.8.0-SNAPSHOT</version>
2323

2424
<properties>
2525
<java.version>8</java.version>
@@ -159,6 +159,12 @@
159159
<version>0.0.4-SNAPSHOT</version>
160160
</dependency>
161161

162+
<dependency>
163+
<groupId>org.smartregister.hapi-fhir-opensrp-extensions</groupId>
164+
<artifactId>configuration</artifactId>
165+
<version>0.0.1-SNAPSHOT</version>
166+
</dependency>
167+
162168
<!-- 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
163169
is used here, but log4j would also be fine. -->
164170
<dependency>

src/main/java/ca/uhn/fhir/jpa/starter/Application.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig;
77
import ca.uhn.fhir.jpa.subscription.match.config.WebsocketDispatcherConfig;
88
import ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig;
9+
import org.smartregister.extension.configuration.OpenSRPExtensionConfiguration;
910
import org.springframework.beans.factory.annotation.Autowired;
1011
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
1112
import org.springframework.boot.SpringApplication;
@@ -26,7 +27,7 @@
2627
@ServletComponentScan(basePackageClasses = {
2728
JpaRestfulServer.class})
2829
@SpringBootApplication(exclude = {ElasticsearchRestClientAutoConfiguration.class})
29-
@Import({SubscriptionSubmitterConfig.class, SubscriptionProcessorConfig.class, SubscriptionChannelConfig.class, WebsocketDispatcherConfig.class, MdmConfig.class})
30+
@Import({SubscriptionSubmitterConfig.class, SubscriptionProcessorConfig.class, SubscriptionChannelConfig.class, WebsocketDispatcherConfig.class, MdmConfig.class, OpenSRPExtensionConfiguration.class})
3031
@EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class})
3132
public class Application extends SpringBootServletInitializer {
3233

src/main/resources/application.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,14 @@ keycloak:
191191
# use-resource-role-mappings: true,
192192
logging.level.org.springframework.web: trace
193193
logging.level.org.apache: trace
194+
195+
#sentry:
196+
# enabled: false
197+
# options:
198+
# dsn:
199+
# release:
200+
# environment:
201+
# tags:
202+
# debug: false
203+
# minimumEventLevel: ERROR
204+
# minimumBreadcrumbLevel: INFO

src/main/resources/logback.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
<appender-ref ref="STDOUT" />
1717
</logger>
1818

19+
<!-- Start Sentry Appender Configuration -->
20+
<!-- Sentry appender disabled by default, to enable set sentry.enabled property to true on the application.yaml-->
21+
<springProperty name="sentry.enabled" source="sentry.enabled" />
22+
<property name="sentry.appender.enabled" value="${sentry.enabled}" />
23+
<if condition='property("sentry.appender.enabled").equals("true")'>
24+
<then>
25+
<include optional="true" resource="sentry-logback.xml" />
26+
</then>
27+
</if>
28+
<!-- End Sentry Appender Configuration -->
29+
1930
<root level="INFO">
2031
<appender-ref ref="STDOUT" />
2132
</root>

0 commit comments

Comments
 (0)