Comments (3)
Hello,
what are you trying to achieve? If you're trying to use correlated logging (log span and trace ids), Spring Boot 3.2.x supports this out of the box: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.micrometer-tracing.logging
If that doesn't fix your issue, please attach a sample project which we can unzip or clone. Thanks!
from spring-boot.
As shown in the screenshot, in spring boot 3.2.5 the application name, log span and trace ids are displayed repeatedly, only the logging.pattern.level
in green is enough.
from spring-boot.
The duplicated application name, span id and trace id in the logs with Boot 3.2.x are happening because you set the logging pattern for the level to include them:
logging.pattern.level=%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]
this works in Boot 3.1.x, as Boot 3.1.x has no built-in support itself for trace id and span id.
In Boot 3.2.x, this support has been added. There's a new property called logging.pattern.correlation
, which contains the trace id and the span id, and which is logged by default if tracing is enabled in the application. Additionally, there's logging.include-application-name which defaults to true
and adds the application name to the log.
So now there are multiple variables (logging.pattern.level
and logging.pattern.correlation
and logging.include-application-name
) which contain the application name, trace id and span id. Hence the duplicated stuff in your screenshot.
To fix your setup in 3.2.x, remove [${spring.application.name:},%X{traceId:-},%X{spanId:-}]
from logging.pattern.level
and, if you need to customize trace id / span id logging, use logging.pattern.correlation
.
I'm going to add something to the upgrade guide about that.
from spring-boot.
Related Issues (20)
- Relocate test CNB builder used in plugin integration tests
- Upgrade to MySQL 8.4.0 LTS HOT 1
- [Enhancement] Request to add "connection: close" response header via http/1.1 connection after graceful shutdown phase started HOT 1
- Disable system test that's broken by the latest jammy builder
- Disable system test that's broken by the latest jammy builder
- Disable system test that's broken by the latest jammy builder
- Consider update to MySQL 8.4.0 HOT 1
- Upgrade to Jetty Reactive HTTPClient 3.0.13
- Upgrade to Spring Retry 2.0.6
- Upgrade to Jetty Reactive HTTPClient 4.0.4
- Upgrade to Pulsar Reactive 0.5.5
- Upgrade to Jetty Reactive HTTPClient 4.0.4
- Upgrade to Pulsar Reactive 0.5.5
- Publish the first snapshot after a version bump more quickly
- Publish the first snapshot after a version bump more quickly
- Publish the first snapshot after a version bump more quickly
- Upgrade to Antora UI Spring 0.4.15
- Add external link indicators to API docs in Antora
- Relocate test CNB builder used in plugin integration tests
- Relocate test CNB builder used in plugin integration tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.