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 22
33namespace Illuminated \Console ;
44
5+ use Illuminate \Support \Str ;
56use Illuminated \Console \Log \Formatter ;
67use Monolog \Handler \RotatingFileHandler ;
78use Monolog \Logger ;
@@ -45,14 +46,16 @@ protected function initializeLogging()
4546
4647 private function getLogHandlers ()
4748 {
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 );
5350 $ rotatingFileHandler ->setFilenameFormat ('{date} ' , 'Y-m-d ' );
5451 $ rotatingFileHandler ->setFormatter (new Formatter ());
5552
5653 return [$ rotatingFileHandler ];
5754 }
55+
56+ protected function getLogPath ()
57+ {
58+ $ name = Str::replaceFirst (': ' , '/ ' , $ this ->getName ());
59+ return storage_path ("logs/ {$ name }/date.log " );
60+ }
5861}
You can’t perform that action at this time.
0 commit comments