Skip to content

Commit b9848fd

Browse files
committed
Update remote content FOLIO-3311
1 parent 5977a6a commit b9848fd

1 file changed

Lines changed: 30 additions & 51 deletions

File tree

_remote/folio-spring-support/README.md

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ Version 2.0. See the file "[LICENSE](LICENSE)" for more information.
1919
- [CQL support](#cql-support)
2020
- [Logging](#logging)
2121
- [Default logging format](#default-logging-format)
22-
- [Logging for incoming and outgoing requests](#logging-for-incoming-and-outgoing-requests)
23-
- [Log examples:](#log-examples)
22+
- [Request and Response Logging](#request-and-response-logging)
2423
- [Custom `/_/tenant` Logic](#custom-_tenant-logic)
2524
- [`TenantService` Event Methods](#tenantservice-event-methods)
2625
- [`TenantService` Methods and Fields](#tenantservice-methods-and-fields)
@@ -176,58 +175,38 @@ Library uses [log4j2](https://logging.apache.org/log4j/2.x/) for logging. There
176175
To choose the JSON structured logging by using setting: `-Dlog4j.configurationFile=log4j2-json.properties`
177176
A module that wants to generate log4J2 logs in a different format can create a `log4j2.properties` file in the /resources directory.
178177

179-
### Logging for incoming and outgoing requests
180-
181-
By default, logging for incoming and outgoing request enabled. Module could disable it by setting:
182-
183-
- `folio.logging.request.enabled = false`
184-
- `folio.logging.feign.enabled = false`
185-
186-
Also, it is possible to specify logging level:
187-
`none` - no logs
188-
`basic` - log request method and URI, response status and spent time
189-
`headers` - log all that `basic` and request headers
190-
`full` - log all that `headers` and request and response bodies
191-
192-
**_Note:_** _In case you have async requests in your module (DeferredResult, CompletableFuture, etc.) then you should disable default logging for requests._
193-
194-
#### Log examples:
195-
196-
- basic:
197-
198-
```text
199-
18:41:18 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter ---> PUT /records-editor/records/c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1 null
200-
18:41:19 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter <--- 202 in 753ms
178+
### Request and Response Logging
179+
180+
For comprehensive information about HTTP request and response logging, including:
181+
- Request Logging (incoming requests to your application)
182+
- Exchange Logging (outgoing HTTP client requests)
183+
- Logging levels (NONE, BASIC, HEADERS, FULL)
184+
- Configuration examples
185+
- Performance and security considerations
186+
187+
See the [Request Logging Guide](doc/REQUEST_LOGGING.md).
188+
189+
**Quick Configuration:**
190+
191+
```yaml
192+
folio:
193+
logging:
194+
request:
195+
enabled: true
196+
level: BASIC # NONE, BASIC, HEADERS, FULL
197+
exchange:
198+
enabled: true
199+
level: BASIC # NONE, BASIC, HEADERS, FULL
200+
201+
logging:
202+
level:
203+
org.folio.spring.filter.IncomingRequestLoggingFilter: DEBUG
204+
org.folio.spring.client.ExchangeLoggingInterceptor: DEBUG
201205
```
202206
203-
- headers:
204-
205-
```text
206-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter ---> PUT /records-editor/records/c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1 null
207-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-url: http://localhost:50017
208-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-tenant: <tenantId>
209-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-request-id: <requestId>
210-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-user-id: <userId>
211-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter content-type: application/json; charset=UTF-8
212-
18:44:23 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter ---> END HTTP
213-
18:44:24 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter <--- 202 in 786ms
214-
```
207+
**Note:** In case you have async requests in your module (DeferredResult, CompletableFuture, etc.) then you should disable default logging for requests.
215208
216-
- full:
217-
218-
```text
219-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter ---> PUT /records-editor/records/c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1 null
220-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-url: http://localhost:53146
221-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-tenant: <tenantId>
222-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-request-id: <requestId>
223-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter x-okapi-user-id: <userId>
224-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter content-type: application/json; charset=UTF-8
225-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter Body: {"parsedRecordId":"c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1","parsedRecordDtoId":"c56b70ce-4ef6-47ef-8bc3-c470bafa0b8c","suppressDiscovery":false}
226-
18:46:17 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter ---> END HTTP
227-
18:46:18 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter <--- 202 in 714ms
228-
18:46:18 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter Body:
229-
18:46:18 [<requestId>] [<tenantId>] [<userId>] [<moduleId>] INFO LoggingRequestFilter <--- END HTTP
230-
```
209+
---
231210
232211
## Custom `/_/tenant` Logic
233212

0 commit comments

Comments
 (0)