File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Illuminated \Console ;
4
4
5
+ use Illuminate \Support \Str ;
5
6
use Illuminated \Console \Log \Formatter ;
6
7
use Monolog \Handler \RotatingFileHandler ;
7
8
use Monolog \Logger ;
@@ -45,14 +46,16 @@ protected function initializeLogging()
45
46
46
47
private function getLogHandlers ()
47
48
{
48
- $ type = $ this ->type ();
49
- $ entity = $ this ->argument ('entity ' );
50
- $ path = storage_path ("logs/cloud/ {$ type }/ {$ entity }/date.log " );
51
-
52
- $ rotatingFileHandler = new RotatingFileHandler ($ path , 30 );
49
+ $ rotatingFileHandler = new RotatingFileHandler ($ this ->getLogPath (), 30 );
53
50
$ rotatingFileHandler ->setFilenameFormat ('{date} ' , 'Y-m-d ' );
54
51
$ rotatingFileHandler ->setFormatter (new Formatter ());
55
52
56
53
return [$ rotatingFileHandler ];
57
54
}
55
+
56
+ protected function getLogPath ()
57
+ {
58
+ $ name = Str::replaceFirst (': ' , '/ ' , $ this ->getName ());
59
+ return storage_path ("logs/ {$ name }/date.log " );
60
+ }
58
61
}
You can’t perform that action at this time.
0 commit comments