Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public class LogbookGcpAutoConfiguration {
@Bean
public LogbookLoggingCloudProperties logbookCloudConfiguration() {
LogbookLoggingCloudProperties c = new LogbookLoggingCloudProperties();
// subtract a few kb for headers and other wrapping
c.setMaxBodySize(131072 - 2 * 1024);
c.setMaxSize(131072);
// hard limit as of April 2026: 256 KiB - where KiB is 1024 bytes
// Body: set it to 224 KiB to be on the safe side,
// and to allow for a lot of overhead in the logging framework, MDC, HTTP headers, bytes vs chars, etc.
c.setMaxBodySize(229376);
c.setMaxSize(262144 - 2 * 1024); // inaccurate + currently not enforced
Comment thread
skjolber marked this conversation as resolved.
Comment thread
skjolber marked this conversation as resolved.
return c;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public class RequestResponseGcpGrpcSpringAutoConfiguration {
@Bean
public GrpcLoggingCloudProperties grpcLoggingCloudProperties() {
GrpcLoggingCloudProperties c = new GrpcLoggingCloudProperties();
// subtract a few kb for headers and other wrapping
c.setMaxBodySize(131072 - 2 * 1024);
c.setMaxSize(131072);
// hard limit as of April 2026: 256 KiB - where KiB is 1024 bytes
// Body: set it to 224 KiB to be on the safe side,
Comment thread
skjolber marked this conversation as resolved.
// and to allow for a lot of overhead in the logging framework, MDC, HTTP headers, bytes vs chars, etc.
c.setMaxBodySize(229376);
c.setMaxSize(262144 - 2 * 1024); // inaccurate + currently not enforced
Comment thread
skjolber marked this conversation as resolved.
return c;
}
}
9 changes: 9 additions & 0 deletions guides/gRPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ testImplementation ("no.entur.logging.cloud:request-response-spring-boot-starter
```
</details>

Please note:

* GCP `LogEntry` has a hard size limit of 256 KiB. Request/response bodies are truncated at 224 KiB by default to stay safely within this limit, accounting for headers, MDC fields, and other log-framework overhead. Override the default using:
```
entur.logging.request-response.max-body-size=<bytes>
entur.logging.request-response.max-size=<bytes>
```
See also: [Too long lines](troubleShooting.md#too-long-lines).

Adjust the logger using

```
Expand Down
2 changes: 1 addition & 1 deletion guides/troubleShooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ Does not always translate into `textPayload`.

> Failed to process request with tag kube_abt-xxx_abt-ccc-79d5974b67-jdsk8_abt-ccc_stdout: rpc error: code = InvalidArgument desc = Log entry with size 278.8K exceeds maximum size of 256.0K

Resolution: Truncate long values.
Resolution: Truncate long values. For request-response logging, the library automatically truncates request/response bodies at 224 KiB by default (GCP `LogEntry` max is 256 KiB). The limit can be lowered further via `entur.logging.request-response.max-body-size`.
6 changes: 6 additions & 0 deletions guides/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ Please note:
* For request-response-logging, this library assumes that locally produced JSON has valid syntax and is without pretty-printing.
* This assumption is made so to avoid the processing overhead of unnecessarily parsing JSON documents known to be valid.
* If this assumption for some reason does not hold, use a BodyFilter to compensate.
* GCP `LogEntry` has a hard size limit of 256 KiB. Request/response bodies are truncated at 224 KiB by default to stay safely within this limit, accounting for headers, MDC fields, and other log-framework overhead. Override the default using:
```
entur.logging.request-response.max-body-size=<bytes>
entur.logging.request-response.max-size=<bytes>
```
See also: [Too long lines](troubleShooting.md#too-long-lines).

Some Logbook excludes ([actuator, openapi](https://github.com/entur/cloud-logging/blob/main/request-response/logbook-spring-boot-autoconfigure/src/main/java/no/entur/logging/cloud/spring/logbook/LogbookLoggingAutoConfiguration.java)) are included by default. Add more using

Expand Down
Loading