Use tracing only where it provides diagnostic value—not for every line of code.
- Trace key execution points: method entry/exit, important business logic, API calls, exceptions, and decision branches.
- Avoid excessive tracing: it impacts performance and makes logs difficult to analyze.
- SQL parameters: Do not trace SQL parameter values in production, especially if they contain sensitive or personal data. Log parameter names or counts if needed, and enable detailed parameter logging only temporarily for debugging in a secure environment.