Remove a logger by passing in its instance.

@param LoggerInterface $logger
@param bool $trigger
@return AggregateLogger
2114
public function removeLoggerByInstance($logger, $trigger = true) {
        foreach ($this->loggers as $key => $addedLogger) {
            if ($addedLogger[0] === $logger) {
                unset($this->loggers[$key]);
                return $this;
            }
        }

        if ($trigger) {
            $class = get_class($logger);
            trigger_error("Logger $class was removed without being added.");
        }

        return $this;
    }
377137
public static function log(
        LoggerInterface $logger,
        GuzzleLogMessageFormatter $messageFormatter
    ) {
        return function (callable $handler) use ($logger, $messageFormatter) {
            return function ($request, array $options) use ($handler, $logger, $messageFormatter) {
                return $handler($request, $options)->then(

                    function ($response) use ($request, $logger, $messageFormatter) {
                        // Logs messages in case of successful HTTP calls.
                        $logger->info(
                            $messageFormatter->formatSummary($request, $response)
                        );

                        // formatDetailed() can produce long log messages
                        // so check if it handles DEBUG level when possible.
                        if (!($logger instanceof Logger)
                            || $logger->isHandling(Logger::DEBUG)) {
                            $logger->debug($messageFormatter->formatDetailed(
                                $request,
                                $response
                            ));
                        }

                        return $response;
                    },
                    function ($reason) use ($request, $logger, $messageFormatter) {
                        // Logs messages in case of failing HTTP calls.
                        $response = is_subclass_of(
                            $reason,
                            'GuzzleHttp\Exception\RequestException'
                        ) ? $reason->getResponse() : null;

                        $logger->warning(
                            $messageFormatter->formatSummary($request, $response)
                        );

                        // formatDetailed() can produce long log messages
                        // so check if it handles NOTICE level when
                        // possible.
                        if (!($logger instanceof Logger)
                            || $logger->isHandling(Logger::NOTICE)) {
                            $logger->notice($messageFormatter->formatDetailed(
                                $request,
                                $response,
                                $reason
                            ));
                        }

                        return \GuzzleHttp\Promise\rejection_for($reason);
                    }
                );
            };
        };
    }
468836
protected function deleteTrigger()
    {
        $this->controlAccess('trigger_delete');

        if ($this->trigger->delete($this->data_trigger['trigger_id'])) {
            $this->redirect('admin/settings/trigger', $this->text('Trigger has been deleted'), 'success');
        }

        $this->redirect('', $this->text('Trigger has not been deleted'), 'warning');
    }
84389
public function setLogger($logger = null)
    {
        if (! (is_null($logger)
            || $logger instanceof LoggerInterface)) {
            throw new InvalidArgumentException(
                'Argument to ' . __METHOD__ .
                " must be a valid Logger Interface (aka. Monolog), " .
                get_class($logger) . ' given.'
            );
        }

        $this->logger = $logger;
    }
961336
public function setLogger($logger)
    {
        if (!method_exists($logger, 'info'))
        {
            throw new Exception('logger need have method "info($message)"');
        }
        if (!method_exists($logger, 'error'))
        {
            throw new Exception('logger need have method "error($message)"');
        }
        $this->logger = $logger;
    }
1014066
public function log(LoggerInterface $logger, array $context = [])
    {
        $this->addContext($context);
        $logger->log($this->getLevel(), $this->getMessage(), $this->getContext());

        return $this;
    }
919376
public function handle(LogManager $logger): void
    {
        $db = \resolve('db');

        $callback = $this->buildQueryCallback($logger);

        foreach ($db->getQueryLog() as $query) {
            $callback(new QueryExecuted($query['query'], $query['bindings'], $query['time'], $db));
        }

        \resolve(Dispatcher::class)->listen(QueryExecuted::class, $callback);
    }
818096
private function initialize_logger( Logger $logger ) {

		$default_handler = $this->use_default_handler( $logger );
		$default_handler and $logger = $logger->pushHandler( $default_handler );

		$default_processor = $this->use_default_processor( $logger );
		$default_processor and $logger = $logger->pushProcessor( $default_processor );

		/**
		 * Fires right before a logger is used for the first time.
		 *
		 * Hook here to set up the logger (e.g., add handlers or processors).
		 *
		 * @param Logger             $logger
		 * @param HandlersRegistry   $handlers_registry
		 * @param ProcessorsRegistry $processors_registry
		 */
		do_action( self::ACTION_LOGGER, $logger, $this->handlers_registry, $this->processors_registry );

		return $logger;
	}
389505
public function getLogger(): LoggerInterface
    {
        if ($this->logger === null) {
            $this->setLogger(new NullLogger());
        }
        assert($this->logger instanceof LoggerInterface);
        return $this->logger;
    }
949869
public function setLogger(LoggerInterface $logger)
    {
        parent::setLogger($logger);
        foreach ($this->plugins as $plugin) {
            if (!($plugin instanceof LoggerAwareInterface)) {
                continue;
            }

            $plugin->setLogger($logger);
        }
    }
223675
public function setExitTrigger($trigger)
    {
        $validTriggers = [
            'die',
            'exception'
        ];
        if (!in_array($trigger, $validTriggers)) {
            throw new OAuth2Exception(('Invalid exit trigger "' . $trigger . '".'));
        }

        $this->exitTrigger = $trigger;
    }
1152909
public function setLogger(\BearFramework\App\ILogger $logger): self
    {
        if ($this->logger !== null) {
            throw new \Exception('A logger is already set!');
        }
        $this->logger = $logger;
        return $this;
    }
182184
private function setLogger($logger)
    {
        $psr = 'Psr\\Log\\LoggerInterface';
        if (!is_a($logger, $psr)) {
            throw new InvalidArgumentException(
                sprintf('Expected an instance of %s', $psr)
            );
        }

        $this->logger = $logger;
    }
1107206
public function setLogger(Logger $logger, $verbosity = 0, $paranoid = true)
    {
        $this->logger = $logger;
        if ($paranoid) {
            register_shutdown_function(array($this, 'endOfScript'));
        }
        set_error_handler(array($this, 'errorHandler'));
        set_exception_handler(array($this, 'exceptionHandler'));

        if ($verbosity == OutputInterface::VERBOSITY_VERBOSE) {
            $logger->pushHandler(
                new StreamHandler(fopen('php://stdout', 'w'), Logger::DEBUG, false)
            );
            $logger->pushProcessor(new MemoryUsageProcessor);
            $logger->pushProcessor(new MemoryPeakUsageProcessor);
        }
        if ($verbosity == OutputInterface::VERBOSITY_NORMAL) {
            $logger->pushHandler(
                new StreamHandler(fopen('php://stdout', 'w'), Logger::INFO, false)
            );
        }
        $logger->pushHandler(new StreamHandler(fopen('php://stderr', 'w'), Logger::WARNING));
    }
759700
public function setLogger(string $id, LoggerInterface $logger): self
    {
        $this->_loggers[$id] = $logger;

        return $this;
    }
1094013
protected function getListenClosure(SqlLogger $logger)
    {
        return function ($query, $bindings = null, $time = null) use ($logger) {
            $logger->log($query, $bindings, $time);
        };
    }
895956
@Override
	public boolean removeTrigger(String groupName, String jobName, final String triggerGroup, final String triggerName) throws SchedulerException {
		if (!config.isRemoveTriggerAllowed()) {
			LOGGER.warn("not allowed to remove any trigger");
			return false;
		}
		Trigger triggerFound = findTrigger(groupName, jobName, triggerGroup, triggerName);
		if (null != triggerFound) {
			return scheduler.unscheduleJob(triggerFound.getKey());
		}
		return false;
	}