-
Notifications
You must be signed in to change notification settings - Fork 941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContentPreviewingService logs are inserted after custom logs #6132
Comments
Did you set the trace ID using
The request and response logs are written together, so it is difficult to inject add armeria/core/src/main/java/com/linecorp/armeria/internal/common/logging/LoggingUtils.java Lines 41 to 50 in ed16bf6
One possible workaround is implementing a custom LogWriter and composing it with the default LogWriter using .andThen() .
LogWriter logWriter = LogWriter.of().andThen(new LogWriter() {
@Override
public void logRequest(RequestOnlyLog log) {
logger.info("MY CUSTOM LOGS...");
}
@Override
public void logResponse(RequestLog log) {
// DO NOTHING
}
});
LoggingService.builder()
.logWriter(logWriter)
.newDecorator(); |
thanks for your response, TraceID is added like this:
an my custom logs are not added via decorator but directly in my services, so inside my post/get/etc methods... and before the return |
I've added some decorators to my ServerBuilder:
With these decorators I would expect log output like this:
but the output that i optain is:
and request/response do not contain the traceId value that I added as a custom decorator (while all the others do).
How can I get the logs to be written in the correct order?
The text was updated successfully, but these errors were encountered: