From cd31512b62171e3f18e63c24e170da0533c20f30 Mon Sep 17 00:00:00 2001 From: shayaantx <5449086+shayaantx@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:02:27 -0500 Subject: [PATCH] Log exceptions when they are thrown --- .../com/botdarr/api/ArrRequestBuilder.java | 6 +++--- src/main/resources/log4j2.xml | 20 +++++++++---------- src/main/resources/version.txt | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/botdarr/api/ArrRequestBuilder.java b/src/main/java/com/botdarr/api/ArrRequestBuilder.java index 3aa28dd..dbc25ac 100644 --- a/src/main/java/com/botdarr/api/ArrRequestBuilder.java +++ b/src/main/java/com/botdarr/api/ArrRequestBuilder.java @@ -24,7 +24,7 @@ private RequestBuilder tokens(RequestBuilder requestBuilder) { .headers("X-Api-Key", Config.getProperty(this.tokenName)); } - private String getRadarrHost() { + private String getHost() { String host = Config.getProperty(this.urlConfigName); String rawUrlBase = Config.getProperty(this.urlBaseConfigName); String urlBase = Strings.isBlank(rawUrlBase) ? "" : "/" + rawUrlBase; @@ -43,12 +43,12 @@ public RequestBuilder buildGet(String path, Map params) { for (Map.Entry entry : params.entrySet()) { this.requestBuilder.param(entry.getKey(), entry.getValue()); } - RequestBuilder requestBuilder = this.requestBuilder.host(getRadarrHost() + path); + RequestBuilder requestBuilder = this.requestBuilder.host(getHost() + path); return this.tokens(requestBuilder); } public RequestBuilder buildPost(String path, String postBody) { - RequestBuilder requestBuilder = this.requestBuilder.host(getRadarrHost() + path).post(postBody); + RequestBuilder requestBuilder = this.requestBuilder.host(getHost() + path).post(postBody); return this.tokens(requestBuilder); } } \ No newline at end of file diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index bc99b13..2988ac0 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -3,13 +3,13 @@ - + logs/bot.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -21,7 +21,7 @@ logs/audit.log logs/%d{yyyy-MM-dd-hh-mm}.audit.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -33,7 +33,7 @@ logs/radarr.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -45,7 +45,7 @@ logs/sonarr.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -57,7 +57,7 @@ logs/network.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -69,7 +69,7 @@ logs/slack.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -81,7 +81,7 @@ logs/discord.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -93,7 +93,7 @@ logs/matrix.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable @@ -105,7 +105,7 @@ logs/telegram.log logs/%d{yyyy-MM-dd-hh-mm}.log.zip - %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n + %d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %scrubbedMsg%n%throwable diff --git a/src/main/resources/version.txt b/src/main/resources/version.txt index accefef..92989cf 100644 --- a/src/main/resources/version.txt +++ b/src/main/resources/version.txt @@ -1 +1 @@ -5.6.10 \ No newline at end of file +5.6.11 \ No newline at end of file