mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-06 20:54:02 +00:00
Correct log file cleanup
This commit is contained in:
parent
f705f5849f
commit
697ba6592b
1 changed files with 12 additions and 6 deletions
|
|
@ -20,9 +20,12 @@ beforeEach(function () {
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@unlink(storage_path('logs/laravel.log'));
|
$logFiles = array_merge(
|
||||||
@unlink(storage_path('logs/laravel-' . now()->format('Y-m-d') . '.log'));
|
glob(storage_path('logs/*.log')) ?: [],
|
||||||
foreach (glob(storage_path('tenant*/logs/*.log')) ?: [] as $path) {
|
glob(storage_path('tenant*/logs/*.log')) ?: []
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($logFiles as $path) {
|
||||||
@unlink($path);
|
@unlink($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,9 +41,12 @@ afterEach(function () {
|
||||||
LogTenancyBootstrapper::$channelOverrides = [];
|
LogTenancyBootstrapper::$channelOverrides = [];
|
||||||
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
|
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
|
||||||
|
|
||||||
@unlink(storage_path('logs/laravel.log'));
|
$logFiles = array_merge(
|
||||||
@unlink(storage_path('logs/laravel-' . now()->format('Y-m-d') . '.log'));
|
glob(storage_path('logs/*.log')) ?: [],
|
||||||
foreach (glob(storage_path('tenant*/logs/*.log')) ?: [] as $path) {
|
glob(storage_path('tenant*/logs/*.log')) ?: []
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($logFiles as $path) {
|
||||||
@unlink($path);
|
@unlink($path);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue