changed level Debug to Info, refined the approach to specify logging level
This commit is contained in:
parent
a1b6641c06
commit
ec1b55ca31
27
README.md
27
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
|
||||
<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
|
||||
```
|
@ -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") +
|
||||
|
Loading…
Reference in New Issue
Block a user