R
R
rst6302020-01-20 16:43:47
Laravel
rst630, 2020-01-20 16:43:47

Laravel - config logging.channels.single.path - after multiple redefinitions - ambiguous result?

The horizon queue with redis is spinning on the server, in AppServiceProvider.php - Queue::before I assign:

config(['logging.channels.single.path' => storage_path('logs/accounts/'.$command->acc->login.'.log')]);

In order to split all the tasks into different logs - tied to the account login ...
But here's what happens - when the task is one, then everything is fine, it writes to the desired log, as soon as the task becomes more than 1, they start to get confused and write to one log then in the other, everything is in a row, if there are 30 of them at once, then a hash for all the logs. Why is this happening?
I assume that this is due to the fact that after each task I dispatch the same task, perhaps the config is somehow cached to the neighboring task and ignores the new setting, but the queue starts a new process and does not spin in the old one - in theory it should not be like that.
What other options for dynamically setting the log file name can be tried?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question