Skip to content

Commit 3b24c56

Browse files
committed
ICL: Monolog dependency added, Loggable trait continued.
1 parent 8f11e1d commit 3b24c56

File tree

3 files changed

+136
-16
lines changed

3 files changed

+136
-16
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
],
1212
"require": {
1313
"php": ">=5.4.0",
14-
"illuminate/console": "^5.2"
14+
"illuminate/console": "^5.2",
15+
"monolog/monolog": "^1.19"
1516
},
1617
"autoload": {
1718
"psr-4": {

composer.lock

Lines changed: 123 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Loggable.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
namespace Illuminated\Console;
44

5+
use Monolog\Handler\RotatingFileHandler;
6+
use Monolog\Logger;
57
use Symfony\Component\Console\Input\InputInterface;
68
use Symfony\Component\Console\Output\OutputInterface;
79

810
trait Loggable
911
{
10-
protected function initialize(InputInterface $input, OutputInterface $output)
12+
public function run(InputInterface $input, OutputInterface $output)
1113
{
12-
$this->initializeLogging();
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]);
1321

14-
parent::initialize($input, $output);
15-
}
16-
17-
private function initializeLogging()
18-
{
19-
dd('logging');
22+
return parent::run($input, $output);
2023
}
2124
}

0 commit comments

Comments
 (0)