Comments (3)
Hi @lferna
You will be able to disable logging of the mdc using application.config
quarkus.log.console.json.fields.mdc.enabled=false
I have not yet implemented support for providing a custom io.quarkiverse.loggingjson.JsonProvider
, that is the next feature I will implement.
It will getting to look something like this:
@Provider
@ApplicationScoped
public class CustomTraceJsonProvider implements io.quarkiverse.loggingjson.JsonProvider {
@Override
public void writeTo(JsonGenerator generator, ExtLogRecord event) throws IOException {
String traceId = event.getMdc("traceId");
if(traceId != null) {
generator.writeStringField("correlatorId", traceId);
}
}
}
Is that what you are looking for?
from quarkus-logging-json.
Hi @SlyngDK
Thank you for your response. Yes, that is what I'm looking for!
I've found a way to implement this behaviour. With the KeyValueStructureArgumentProvider. It's not very fancy but it works.
LOGGER.info("Test log of structured arg", kv("transaction",((JaegerSpanContext) spanContext).getSpanId()),kv("correlation", ((JaegerSpanContext) spanContext).getTraceId().toString()));
At least it serves to get out of trouble.
Regards,
from quarkus-logging-json.
This is now released in 0.1.6.
from quarkus-logging-json.
Related Issues (20)
- Is this extension still active? HOT 8
- enabling file logging as well HOT 10
- Document changes for new releases HOT 2
- Logging JSON Objects
- Produced ECS log events are invalid HOT 4
- Unable to create new CustomLogHandler HOT 1
- How is this extension different from io.quarkus:quarkus-logging-json? HOT 1
- Ignore some MDC fields HOT 1
- Exclude keys from log HOT 1
- logger does not respect application object mapper HOT 1
- > Null MDC Data when Accessing in public void writeTo(final JsonGenerator generator, final ExtLogRecord event) HOT 1
- GELF format HOT 2
- ECS format - Log event field order does not seem to comply with the ECS standard HOT 1
- The console has custom fields, the log file does not HOT 2
- Import in pom.xml and issue with JSON enablement HOT 2
- io.quarkiverse.jsonlogging - log format is ignored HOT 1
- Adding dynamic additional value? HOT 1
- Updating ECS version from 1.12.1 to 8.x ?
- Malformed JSON with duplicated structured arguments
- Is this the official Quarkus json logging extension? HOT 1
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 quarkus-logging-json.