From a1b6641c068ae1bf32182907b417026d5a4a587d Mon Sep 17 00:00:00 2001 From: bvn13 Date: Mon, 25 Jul 2022 15:26:55 +0300 Subject: [PATCH 1/4] Update for next development version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bd869cd..9809849 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ me.bvn13.openfeign.logger feign-normalized-logger - 0.1.3 + 0.1.4-SNAPSHOT jar From ec1b55ca31fdb44459a67ae2db90284032923678 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Mon, 1 Aug 2022 14:16:38 +0300 Subject: [PATCH 2/4] changed level Debug to Info, refined the approach to specify logging level --- README.md | 27 ++++++++----------- .../normalized/NormalizedFeignLogger.java | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6f991ce..11e1ea7 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ communication into one log entry. ## Old bad Logger -All parts are separeted from each other: +All parts are separated from each other: 1) Request: 1) request headers - every header is put into separated entry - 2) requst body - at separated entry + 2) request body - at separated entry 2) Response: 1) response headers - separately 2) response body - at separated entry as well @@ -99,17 +99,17 @@ for Maven me.bvn13.openfeign.logger feign-normalized-logger - 0.1.0 + 0.1.4 ``` for Gradle ```groovy -implementation 'me.bvn13.openfeign.logger:feign-normalized-logger:0.1.0' +implementation 'me.bvn13.openfeign.logger:feign-normalized-logger:0.1.4' ``` -## 2) Create Feign configuration and enable logger +## 2) Create Feign configuration and enable logger + specify FULL logging level ```java import feign.Logger; @@ -120,6 +120,11 @@ public class MyFeignConfig { public Logger logger() { return new NormalizedFeignLogger(); } + + @Bean + public Logger.Level logLevel() { + return Logger.Level.FULL; + } } ``` @@ -140,15 +145,5 @@ for Slf4J + Logback ```yaml logging: level: - me.bvn13.openfeign.logger.NormalizedFeignLogger: DEBUG + me.bvn13.openfeign.logger.NormalizedFeignLogger: INFO ``` - -### 5) Don't forget to specify FULL log level for your API class - -```yaml -feign: - client: - config: - auth: - logger-level: FULL -``` \ No newline at end of file diff --git a/src/main/java/me/bvn13/openfeign/logger/normalized/NormalizedFeignLogger.java b/src/main/java/me/bvn13/openfeign/logger/normalized/NormalizedFeignLogger.java index 017a6a1..3fc388f 100644 --- a/src/main/java/me/bvn13/openfeign/logger/normalized/NormalizedFeignLogger.java +++ b/src/main/java/me/bvn13/openfeign/logger/normalized/NormalizedFeignLogger.java @@ -95,7 +95,7 @@ public class NormalizedFeignLogger extends feign.Logger { } private void showLogs(String configKey) { - log.debug("normalized feign request " + methodName.get() + ": [\n" + + log.info("Normalized feign request " + methodName.get() + ": [\n" + collectionToDelimitedString(logsRequest.get().getOrDefault(configKey, Collections.emptyList()), "\n") + "\n] has response [\n" + collectionToDelimitedString(logsResponse.get().getOrDefault(configKey, Collections.emptyList()), "\n") + From 4835a1ebd70592f37d80846272ce8f249e24448d Mon Sep 17 00:00:00 2001 From: bvn13 Date: Mon, 1 Aug 2022 14:20:33 +0300 Subject: [PATCH 3/4] publishing script --- publish.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 publish.sh diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..6c40cd8 --- /dev/null +++ b/publish.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +./mvnw gitflow:release-start gitflow:release-finish + +git push origin master + +git push --tags + +git push origin develop + +read -p "Which version to publish? > " version + +git checkout $version + +./mvnw deploy -Prelease \ No newline at end of file From ab5020093975b3e6ecf70202f3a4be391f0b8a01 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Mon, 1 Aug 2022 14:20:48 +0300 Subject: [PATCH 4/4] Update versions for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9809849..8817262 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ me.bvn13.openfeign.logger feign-normalized-logger - 0.1.4-SNAPSHOT + 0.1.4 jar