Merge branch 'release/0.1.4'

This commit is contained in:
bvn13 2022-08-01 14:20:54 +03:00
commit fca67c061b
4 changed files with 28 additions and 18 deletions

View File

@ -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
<dependency>
<groupId>me.bvn13.openfeign.logger</groupId>
<artifactId>feign-normalized-logger</artifactId>
<version>0.1.0</version>
<version>0.1.4</version>
</dependency>
```
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
```

View File

@ -7,7 +7,7 @@
<groupId>me.bvn13.openfeign.logger</groupId>
<artifactId>feign-normalized-logger</artifactId>
<version>0.1.3</version>
<version>0.1.4</version>
<packaging>jar</packaging>

15
publish.sh Executable file
View File

@ -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

View File

@ -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") +