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: README.rst
+3-6Lines changed: 3 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,8 @@ Setting and getting correlation ID
159
159
""""""""""""""""""""""""""""""""""
160
160
161
161
When using cf_logging in a web application you don't need to set the correlation ID, because the logging library will fetch it from the HTTP headers and set it.
162
-
For non web applications you could set the correlation ID manually, so that the log entries can be filtered later on based on the correlation_id.
162
+
For non web applications you could set the correlation ID manually, so that the log entries can be filtered later on based on the ``correlation_id`` log property.
163
+
In this case the correlation ID is kept in a thread local variable and each thread should set its own correlation ID.
163
164
164
165
Setting and getting the correlation_id can be done via:
165
166
@@ -168,11 +169,7 @@ Setting and getting the correlation_id can be done via:
Whenever a correlation id is set after initializing cf_logging without a specific framework (ex: cf_logging.init()) - this same correlation ID would be used for each log record.
172
-
173
-
If you need a *thread safe* correlation ID, you can reuse the ``cf_logging.job_loffing.framework.JobFramework`` and provide your own context implementation that is *thread safe*.
174
-
175
-
If you need to get the correlation_id in a web application, take into account the framework you are using.
172
+
If you need to get the correlation ID in a web application, take into account the framework you are using.
176
173
In async frameworks like Sanic and Falcon the context is stored into the request object and you need to provide the request to the call:
0 commit comments