1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-06 19:04:04 +00:00

Preserve filename from central log path in tenant context

This commit is contained in:
lukinovec 2026-04-14 10:46:15 +02:00
parent 9ea3813d28
commit 23ae15a8f1
2 changed files with 44 additions and 1 deletions

View file

@ -133,7 +133,9 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
} elseif (in_array($channel, static::$storagePathChannels)) {
// Set storage path channels to use tenant-specific directory (default behavior)
// The tenant log will be located at e.g. "storage/tenant{$tenantKey}/logs/laravel.log" (assuming FilesystemTenancyBootstrapper is used before this bootstrapper)
$this->config->set("logging.channels.{$channel}.path", storage_path('logs/laravel.log'));
$path = $this->config->get("logging.channels.{$channel}.path");
$this->config->set("logging.channels.{$channel}.path", storage_path('logs/' . ($path ? basename($path) : 'laravel.log')));
}
}
}