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

Correct log file cleanup

This commit is contained in:
lukinovec 2026-04-13 14:23:39 +02:00
parent f705f5849f
commit 697ba6592b

View file

@ -20,9 +20,12 @@ beforeEach(function () {
],
]);
@unlink(storage_path('logs/laravel.log'));
@unlink(storage_path('logs/laravel-' . now()->format('Y-m-d') . '.log'));
foreach (glob(storage_path('tenant*/logs/*.log')) ?: [] as $path) {
$logFiles = array_merge(
glob(storage_path('logs/*.log')) ?: [],
glob(storage_path('tenant*/logs/*.log')) ?: []
);
foreach ($logFiles as $path) {
@unlink($path);
}
@ -38,9 +41,12 @@ afterEach(function () {
LogTenancyBootstrapper::$channelOverrides = [];
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
@unlink(storage_path('logs/laravel.log'));
@unlink(storage_path('logs/laravel-' . now()->format('Y-m-d') . '.log'));
foreach (glob(storage_path('tenant*/logs/*.log')) ?: [] as $path) {
$logFiles = array_merge(
glob(storage_path('logs/*.log')) ?: [],
glob(storage_path('tenant*/logs/*.log')) ?: []
);
foreach ($logFiles as $path) {
@unlink($path);
}
});