How to update logging config properly when tenant is switched #388
-
I use a custom public function makeCurrent(Tenant $tenant): void
{
config()->set('logging.channels.daily.path', storage_path("app/tenant-{$tenant->id}/logs/laravel.log"));
} This works, logs are going to the dedicated path. public function makeCurrent(Tenant $tenant): void
{
Log::debug('test');
config()->set('logging.channels.daily.path', storage_path("app/tenant-{$tenant->id}/logs/laravel.log"));
} I also tried to add the provided Can someone point me in the right direction understanding this behavior? I worry that this might happen with other things as well that are called prior switch tenant tasks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
What about a task to create an on-demand channel? |
Beta Was this translation helpful? Give feedback.
What about a task to create an on-demand channel?
https://laravel.com/docs/9.x/logging#on-demand-channels