Skip to content

Commit 149b24f

Browse files
committed
Add compatibility with Laravel 5.6
1 parent 15131ee commit 149b24f

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/Commands/Rotate.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@ class Rotate extends Command
1313

1414
public function handle()
1515
{
16-
if (config('app.log') == 'single') {
17-
$result = RotateFile::file(
18-
app()->storagePath().'/logs/laravel.log',
19-
config('rotate.log_max_files', config('app.log_max_files')),
20-
config('rotate.log_compress_files', true)
21-
);
16+
$result = RotateFile::file(
17+
app()->storagePath().'/logs/laravel.log',
18+
config('rotate.log_max_files', 7),
19+
config('rotate.log_compress_files', true)
20+
);
2221

23-
if ($result) {
24-
$this->info('Logs was rotated');
25-
} else {
26-
$this->error('Logs rotate failed');
27-
}
22+
if ($result) {
23+
$this->info('Logs was rotated');
2824
} else {
29-
$this->error('Laravel must be configure with single log. You can change this in app/config.php');
25+
$this->error('Logs rotate failed');
3026
}
3127
}
3228
}

src/config/rotate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
return [
4-
'log_max_files' => config('app.log_max_files'),
4+
'log_max_files' => env('LOG_MAX_FILES', 5),
55

66
'log_compress_files' => true,
77

0 commit comments

Comments
 (0)