Webiny\Component\Logger\Logger::__construct PHP Method

__construct() public method

Create new logger using given name and driver.
A name is used to identify log messages from different loggers.

Having two loggers ("Payment Gateway" and "Invoice Payment") would result in the following output:

[Payment Gateway][info] Request sent.
[Invoice Payment][alert] Paid invoice amount is too small.
public __construct ( string $name, Webiny\Component\Logger\Bridge\LoggerDriverInterface $driverInstance ) : Logger
$name string Logger name
$driverInstance Webiny\Component\Logger\Bridge\LoggerDriverInterface
return Logger
    public function __construct($name, $driverInstance)
    {
        $this->driverInstance = $driverInstance;
        $this->driverInstance->setName($name);
    }