Answer the question
In order to leave comments, you need to log in
How to make logging for each user separately?
Hello.
People tell me how to make sure that the logs (errors and not only) are recorded for each user in their own file.
The only thing that I came up with from the worker is to write this code all the time:
Log::useDailyFiles(storage_path() . '/user_logs/' . Auth::user()->id . '/' . date('Y-m-d') . '.log');
Log::info('Пользователь создал новый проект №' . $id);
Answer the question
In order to leave comments, you need to log in
ActivityLog
packalyst.com/packages/package/spatie/activitylog
Or use Monolog
laravel-tricks.com/tricks/monolog-for-custom-logging
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question