Merge branch 'release/0.1.4'
This commit is contained in:
commit
fca67c061b
27
README.md
27
README.md
@ -12,10 +12,10 @@ communication into one log entry.
|
|||||||
|
|
||||||
## Old bad Logger
|
## Old bad Logger
|
||||||
|
|
||||||
All parts are separeted from each other:
|
All parts are separated from each other:
|
||||||
1) Request:
|
1) Request:
|
||||||
1) request headers - every header is put into separated entry
|
1) request headers - every header is put into separated entry
|
||||||
2) requst body - at separated entry
|
2) request body - at separated entry
|
||||||
2) Response:
|
2) Response:
|
||||||
1) response headers - separately
|
1) response headers - separately
|
||||||
2) response body - at separated entry as well
|
2) response body - at separated entry as well
|
||||||
@ -99,17 +99,17 @@ for Maven
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.bvn13.openfeign.logger</groupId>
|
<groupId>me.bvn13.openfeign.logger</groupId>
|
||||||
<artifactId>feign-normalized-logger</artifactId>
|
<artifactId>feign-normalized-logger</artifactId>
|
||||||
<version>0.1.0</version>
|
<version>0.1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
for Gradle
|
for Gradle
|
||||||
|
|
||||||
```groovy
|
```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
|
```java
|
||||||
import feign.Logger;
|
import feign.Logger;
|
||||||
@ -120,6 +120,11 @@ public class MyFeignConfig {
|
|||||||
public Logger logger() {
|
public Logger logger() {
|
||||||
return new NormalizedFeignLogger();
|
return new NormalizedFeignLogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Logger.Level logLevel() {
|
||||||
|
return Logger.Level.FULL;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -140,15 +145,5 @@ for Slf4J + Logback
|
|||||||
```yaml
|
```yaml
|
||||||
logging:
|
logging:
|
||||||
level:
|
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
|
|
||||||
```
|
|
2
pom.xml
2
pom.xml
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<groupId>me.bvn13.openfeign.logger</groupId>
|
<groupId>me.bvn13.openfeign.logger</groupId>
|
||||||
<artifactId>feign-normalized-logger</artifactId>
|
<artifactId>feign-normalized-logger</artifactId>
|
||||||
<version>0.1.3</version>
|
<version>0.1.4</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
15
publish.sh
Executable file
15
publish.sh
Executable 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
|
@ -95,7 +95,7 @@ public class NormalizedFeignLogger extends feign.Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showLogs(String configKey) {
|
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") +
|
collectionToDelimitedString(logsRequest.get().getOrDefault(configKey, Collections.emptyList()), "\n") +
|
||||||
"\n] has response [\n" +
|
"\n] has response [\n" +
|
||||||
collectionToDelimitedString(logsResponse.get().getOrDefault(configKey, Collections.emptyList()), "\n") +
|
collectionToDelimitedString(logsResponse.get().getOrDefault(configKey, Collections.emptyList()), "\n") +
|
||||||
|
Loading…
Reference in New Issue
Block a user