What is the best way to make logs with React and Python(Django)?

If I have a frontend with React and a backend with Python Django, how can I integrate custom logs?

If I need to store which functions were pressed and when?

Example: We have a PostgreSQL database and there is a file called Logs.txt. When the user opens a specific route, we need to save the time and route name in this file. Also, if there are some buttons that run some functions, we also need to save the time and function name in this log file. Do I need to every time to make a simple request to the backend to save new data about users' pressed history? Or is there some better approach?

Back to Top