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
Copy file name to clipboardExpand all lines: docs/adrs/006-logging-strategy.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ The SDK uses SLF4J API for all logging statements.
50
50
Throughout this document, the term 'request' refers to a single SDK operation that calls an AI service (e.g., `OrchestrationClient.chatCompletion()`, `OpenAiClient.embed()`), distinct from HTTP requests to the user's application.
51
51
52
52
* **Exception logging.**
53
-
When logging exceptions, use standard logging methods (e.g., `log.error("Operation failed", exception)`) rather than serializing exception objects.
53
+
When logging exceptions, use standard logging methods (e.g., `log.debug("Connection lost.", exception)`) rather than serializing exception objects.
54
54
Exception objects may contain custom fields with sensitive data that could be exposed through JSON serialization or custom `toString()` implementations.
55
55
56
56
* **Logging framework**
@@ -156,24 +156,33 @@ The SDK uses SLF4J API for all logging statements.
156
156
157
157
***Safe consumption.**
158
158
Since MDC uses `ThreadLocal` storage, any new thread (created implicitly or explicitly) will not have access to the parent thread's MDC context.
159
-
Always audit for possible thread switches that may lead to corrupted logs due to invalid MDC.
160
-
Below is an example contrasting safe usage (logging in the calling thread) with unsafe usage (logging in callbacks):
159
+
Always audit for thread switches through async operations, resilience patterns etc., as these may lead to corrupted logs due to invalid MDC.
0 commit comments