S
S
skise2017-11-07 23:47:19
Journaling
skise, 2017-11-07 23:47:19

If there are many visitors to the site, what will the logs look like, will there be logs for all users mixed up?

If there are many visitors on the site, and some process is running at the same time, what will the logs look like, will it be all mixed up? I mean, here is a function, all sorts of processes are running in it, and at the same time it is running for, for example, 1000 users - in the logs, for example, they log in it - entering the function, the beginning of the process 1 - the result of the process 1, the beginning of the process 2, the result of the process 2 - and so on .. ., so let's say that these results for each user will be obtained at a different speed - somewhere earlier, somewhere faster, a query to the database or something like that, somewhere something - it took longer.
In the logs how to distinguish all this? there is no guarantee that for the user Vasya when process1 started in the logs there will be the result of process1 just for Vasya? Will everything be mixed up?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-11-07
@RidgeA

If there are many visitors on the site, what will the logs look like?

Exactly the way you program.
In the basic version, yes.
You can write logs for each user/request in a separate file (you must remember that making many files in one directory is a bad idea and clean it up), you can write in the logs for which user/request/whatever this log is written to select logs on this basis , as correctly prompted through grep.
You can add more advanced log analysis tools like ELK-stack if you really need it.
But the basic version with grep hasn't let anyone down yet, if the logs are written correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question