File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 9
9
10
10
trait Loggable
11
11
{
12
- public function run (InputInterface $ input , OutputInterface $ output )
12
+ protected function initialize (InputInterface $ input , OutputInterface $ output )
13
13
{
14
- // $type = $this->type();
15
- // $environment = app()->environment();
16
- // $path = storage_path("logs/cloud/{$type}/{$this->entity}/date.log");
17
- //
18
- // $handler = new RotatingFileHandler($path, 30);
19
- // $handler->setFilenameFormat('{date}', 'Y-m-d');
20
- // $log = new Logger($environment, [$handler]);
14
+ $ this ->initializeLogging ();
15
+ }
16
+
17
+ protected function initializeLogging ()
18
+ {
19
+ $ type = $ this ->type ();
20
+ $ environment = app ()->environment ();
21
+ $ path = storage_path ("logs/cloud/ {$ type }/ {$ this ->entity }/date.log " );
22
+
23
+ $ handler = new RotatingFileHandler ($ path , 30 );
24
+ $ handler ->setFilenameFormat ('{date} ' , 'Y-m-d ' );
25
+ $ log = new Logger ($ environment , [$ handler ]);
21
26
22
- return parent :: run ( $ input , $ output );
27
+ $ log -> info ( ' Hello World! ' );
23
28
}
24
29
}
You can’t perform that action at this time.
0 commit comments