I have a Quarkus service, and would like to log with DataDog trace id for distributed tracing. The trace id is from the request header and differs per request.
In the current setup, I have singleton logger in an @ApplicationScoped
bean, for example,
@ApplicationScoped
public class FooServiceImpl implements FooService {
private static final Logger LOG = LoggerFactory.getLogger(FooServiceImpl.class);
# error occurred, LOG.error("xxx")
How can I inject the request header and use it to enrich my log message?
HttpServerRequest
bean.ContainerRequestFilter
.https://quarkus.io/guides/resteasy-reactive#request-or-response-filters