Keep traces of http requests in Python

I want to keep traces of python code that runs to process HTTP requests.

We use Python and Django.

What is trace in this context?

I want to have this for all traceable http requests:

  • request.META,
  • request.POST
  • request.GET

For each trace, N code execution stacks are executed N times. At the first stage, it would be enough to save the well-known python trace as a string. At the first stage, the value of variables does not need to be saved.

Stack stacks can be created by a supervisor thread or by explicitly invoking a method in the source code. The first step is quite explicit, the supervisor thread can be executed later.

Traces are optional and are for debugging and analysis only. They are not needed to process HTTP requests.

How can this be solved?

- , ? , , .

Update

  • ? . , .
  • HTTP-? , . , N .
-1
3

, . "", "".

, - (, trace module), , , , ..

, / . , /. .

, , .

. , . . ..

, , . , , ( ). ( , , ).

+2
+2

Source: https://habr.com/ru/post/1679937/


All Articles