File tree 2 files changed +9
-13
lines changed
2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,16 @@ class Rotate extends Command
13
13
14
14
public function handle ()
15
15
{
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
+ );
22
21
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 ' );
28
24
} 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 ' );
30
26
}
31
27
}
32
28
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
return [
4
- 'log_max_files ' => config ( ' app.log_max_files ' ),
4
+ 'log_max_files ' => env ( ' LOG_MAX_FILES ' , 5 ),
5
5
6
6
'log_compress_files ' => true ,
7
7
You can’t perform that action at this time.
0 commit comments