You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need better customization and safety in the default logging of decode failures in ServerLog.
Current Challenges:
Limited/inconvenient control of the logging level
Users can't easily change the logging level for decode failures (e.g., from debug to warn) if a request is considered "handled and returning a 4xx response". Such errors go to doLogWhenHandled, which is not always intuitive, especially since there's an additional doLogAllDecodeFailures method and .logAllDecodeFailures(Boolean) flag that doesn't control such cases.
Customisation of error message
The default message is preformatted as (link)
To change this, the user has to write their extension of DefaultServerLog and override decodeFailureHandled.
Safety of ${crx.failure}
If the failure is of type DecodeFailure.Error, it has a field called original: String containing the full input body. In case of JSON decoding errors, it's the full JSON body, which in many cases shouldn't be printed due to its length and possibly sensitive information.
The text was updated successfully, but these errors were encountered:
Inspired by a discussion on the Community Forum: https://softwaremill.community/t/how-to-customize-logging-with-the-server-log-interceptor/361
We need better customization and safety in the default logging of decode failures in
ServerLog
.Current Challenges:
Users can't easily change the logging level for decode failures (e.g., from debug to warn) if a request is considered "handled and returning a 4xx response". Such errors go to
doLogWhenHandled
, which is not always intuitive, especially since there's an additionaldoLogAllDecodeFailures
method and.logAllDecodeFailures(Boolean)
flag that doesn't control such cases.The default message is preformatted as (link)
To change this, the user has to write their extension of
DefaultServerLog
and overridedecodeFailureHandled
.${crx.failure}
If the failure is of type
DecodeFailure.Error
, it has a field calledoriginal: String
containing the full input body. In case of JSON decoding errors, it's the full JSON body, which in many cases shouldn't be printed due to its length and possibly sensitive information.The text was updated successfully, but these errors were encountered: