Skip to content

Commit

Permalink
Merge pull request #3 from fidelize/allow-tag-processors
Browse files Browse the repository at this point in the history
feature: Allow tag processor
  • Loading branch information
renatofl authored Jan 9, 2023
2 parents b602ad9 + 3202a7a commit ad88054
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/MonologLogRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,19 @@ protected function getMonolog()

$logger->pushHandler($handler);

foreach ($this->processors as $processor) {
$logger->pushProcessor(new $processor());
foreach ($this->processors as $id => $processor) {
if (!is_array($processor)) {
$logger->pushProcessor(new $processor());
continue;
}

$params = $processor;
$processor = $id;

$logger->pushProcessor(new $processor($params));
}

Registry::addLogger($logger, $key);

return $logger;
}

Expand Down

0 comments on commit ad88054

Please sign in to comment.