From e8b273abde42a761b110aacee7c17e6366dbfb52 Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <jwalto@essex.ac.uk> Date: Fri, 5 May 2017 18:55:11 +0100 Subject: [PATCH] use sentry + logback --- pom.xml | 7 ++++++- src/main/resources/logback.xml | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/logback.xml diff --git a/pom.xml b/pom.xml index d31fc593..e6504dc2 100644 --- a/pom.xml +++ b/pom.xml @@ -120,7 +120,7 @@ </dependency> <dependency> <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> + <artifactId>slf4j-api</artifactId> <version>1.7.21</version> </dependency> <dependency> @@ -128,5 +128,10 @@ <artifactId>reflections</artifactId> <version>0.9.11</version> </dependency> + <dependency> + <groupId>com.getsentry.raven</groupId> + <artifactId>raven-logback</artifactId> + <version>8.0.2</version> + </dependency> </dependencies> </project> diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 00000000..9b93f104 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,27 @@ +<configuration> + + <appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> + </encoder> + </appender> + + <appender name="Sentry" class="com.getsentry.raven.logback.SentryAppender"> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>WARN</level> + </filter> + <dsn>http://e6162aa6e23f4b2f8af1bebfd8040d0e:a2e5f4a5d98a4c3f9720764252cdc53e@sentry.fossgalaxy.com/6</dsn> + </appender> + + <!-- warnings should ping sentry --> + <root level="warn"> + <appender-ref ref="Sentry" /> + </root> + + <!-- we'll log info to both --> + <root level="INFO"> + <appender-ref ref="Console" /> + <appender-ref ref="Sentry" /> + </root> + +</configuration> \ No newline at end of file -- GitLab