GoogleCloudPlatform / GoogleCloudPlatform/spring-cloud-gcp

Group logs by request Spring Boot - GCP

Open
#3,663 4 comments 3 reactions 0 assignees View on GitHub
priority: p3 type: question
Dominant language
Java
Stars
551
Forks
349
Avg merge
1d 13h
Merged PRs (30d)
14

Description

I have found several posts about this but none that really solve the problem, lot of them are really old

Technology used
- Spring boot: 3.3.3
- Java: 17
- Used log: lombok.extern.slf4j.Slf4j
- Gcp product: Google Cloud Run

Pom.xml dependecy

```




com.google.cloud
libraries-bom
${libraries-bom.version}
pom
import


com.google.cloud
spring-cloud-gcp-dependencies
6.1.0
pom
import




com.google.cloud
spring-cloud-gcp-starter-logging


com.google.cloud
spring-cloud-gcp-starter-trace


org.springframework.boot
spring-boot-starter-web


org.springframework.boot
spring-boot-starter-actuator


org.springframework.restdocs
spring-restdocs-mockmvc
test


com.google.cloud
spring-cloud-gcp-dependencies
2.0.3
pom
import


com.google.cloud
spring-cloud-gcp-starter-storage
2.0.3


org.springframework.boot
spring-boot-starter-security


org.projectlombok
lombok
${lombok.version}
provided


com.fasterxml.jackson.datatype
jackson-datatype-hibernate6
2.15.0


com.fasterxml.jackson.module
jackson-module-mrbean
2.11.0



io.jsonwebtoken
jjwt
0.12.6



org.junit.jupiter
junit-jupiter-api
5.11.3
test


org.springframework.boot
spring-boot-starter-test
test


org.ow2.asm
asm


org.hamcrest
hamcrest-core


```

This is my logback-spring.xml
```






${projectId}










```
If I use `localdev` profile no problem, logs are shown in console and everything is ok.

When I deploy to CloudRun and then use the `dev` profile I have this set of strange logs when I start the spring instance:

![Image](https://github.com/user-attachments/assets/bf26d17a-1f9e-43c8-bb05-a52aa189eb63)

![Image](https://github.com/user-attachments/assets/6be80c7c-a985-41e7-90c1-cdfe3808569c)

And when i call my endpoint this is the result:

![Image](https://github.com/user-attachments/assets/fc92773f-653a-4620-bd48-870443bf189f)

the logs are grouped, it is true, but what do all those warning messages during the start-up of the spring istance mean?

This is an example of my controller:

![Image](https://github.com/user-attachments/assets/bbad3cad-95b0-4b79-a865-ac21a2616530)

Can anyone help me?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.