My team is trying to cut down on extraneous error logging. We have some code that generates a TransportException from an error code. In one particular case, we want to return a 404, which results in a PolicyViolation. This has the same error code as a NotFound exception. But it seems that NotFound exceptions are not logged, whereas PolicyViolations are.
Is there a particular reason for this difference? Would it not make more sense to have the same logging behavior for both?
More generally, we’d like to get rid of error-level logs for client errors/any 400-level TransportException. Is there a particular way you’d recommend doing that?