SAP / cf-java-logging-support

The Java Logging Support for Cloud Foundry supports the creation of structured log messages and the collection of request metrics
Apache License 2.0
77 stars 48 forks source link

Align correlationID filter with LogContext::getCorrelationId() #185

Closed j-denner closed 3 months ago

j-denner commented 3 months ago

Align correlationID filter with LogContext::getCorrelationId()

This PR is a bit tricky about correctness. From a CorrelationIdFilter, the FieldName can be defined and it behaves locally correct. However, LogContext::getCorrelationId() mandates the field Fields.CORRELATION_ID for the correlationId.

It can be seen differently - I prepared a PR instead of an Issue since I personally tend to change it. I classify the change as a low risk that only applies in case a custom correlation id header field is used.

j-denner commented 3 months ago

As I have learned in a call: There are use-cases that set own LogContext fields and therfor, the behavior is as expected and a change would break existing consumers.