Collects log messages from a logger.
This method is an event handler to the {@link CLogger::onFlush} event.
@param CEvent $event event parameter
329188
public function collectLogs($event)
	{
		$logger=Yii::getLogger();
		$dumpLogs=isset($event->params['dumpLogs']) && $event->params['dumpLogs'];
		foreach($this->_routes as $route)
		{
			/* @var $route CLogRoute */
			if($route->enabled)
				$route->collectLogs($logger,$dumpLogs);
		}
	}
66030
public function preFlush(PreFlushEventArgs $event)
    {
        $em = $event->getEntityManager();
        $uow = $em->getUnitOfWork();

        /*
         * We need to use the IdentityMap, because the update and persist collection stores entities, that have
         * computed changes, but translation data might have changed without changing it underlying model!
         */
        foreach($uow->getIdentityMap() as $className) {
            foreach($className as $object) {
                $this->translator->storeTranslationData($object);
            }
        }
    }
622693
public function onClean(SubscriberEvent $event)
    {
        $this->listRepository->clean(
            $event->getListId(),
            $event->getSubscriber()
        );
    }
46579
public void cmsEvent(CmsEvent event) {

        if (!isStaticExportEnabled()) {
            if (LOG.isWarnEnabled()) {
                LOG.warn(Messages.get().getBundle().key(Messages.LOG_STATIC_EXPORT_DISABLED_0));
            }
            return;
        }
        I_CmsReport report = null;
        Map<String, Object> data = event.getData();
        if (data != null) {
            report = (I_CmsReport)data.get(I_CmsEventListener.KEY_REPORT);
        }
        if (report == null) {
            report = new CmsLogReport(CmsLocaleManager.getDefaultLocale(), getClass());
        }
        switch (event.getType()) {
            case I_CmsEventListener.EVENT_UPDATE_EXPORTS:
                scrubExportFolders(report);
                clearCaches(event);
                break;
            case I_CmsEventListener.EVENT_PUBLISH_PROJECT:
                if (data == null) {
                    if (LOG.isErrorEnabled()) {
                        LOG.error(Messages.get().getBundle().key(Messages.ERR_EMPTY_EVENT_DATA_0));
                    }
                    return;
                }
                // event data contains a list of the published resources
                CmsUUID publishHistoryId = new CmsUUID((String)data.get(I_CmsEventListener.KEY_PUBLISHID));
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_EVENT_PUBLISH_PROJECT_1, publishHistoryId));
                }
                synchronized (m_lockCmsEvent) {
                    getHandler().performEventPublishProject(publishHistoryId, report);
                }
                clearCaches(event);

                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_EVENT_PUBLISH_PROJECT_FINISHED_1,
                            publishHistoryId));
                }

                break;
            case I_CmsEventListener.EVENT_CLEAR_CACHES:
                clearCaches(event);
                break;
            default:
                // no operation
        }
    }
724996
public function onBeforeApplicationTerminate(KEventInterface $event)
    {
        if (JDEBUG && !headers_sent())
        {
            $buffer = JProfiler::getInstance('Application')->getBuffer();
            if ($buffer)
            {
                $data = strip_tags(end($buffer));
                $row = array(array($data), null, 'info');

                $header = array(
                    'version' => '4.1.0',
                    'columns' => array('log', 'backtrace', 'type'),
                    'rows'    => array($row)
                );

                header('X-ChromeLogger-Data: ' . base64_encode(utf8_encode(json_encode($header))));
            }
        }
    }
212330
public function append(\n2n\log4php\logging\LoggingEvent $event) {
		$priority = $this->getSyslogPriority($event->getLevel());
		$message = $this->layout->format($event);
	
		openlog($this->ident, $this->intOption, $this->intFacility);
		syslog($priority, $message);
		closelog();
	}
428567
public function onMessageSending(SendMessageEvent $event)
    {
        $receiver = $event->getReceiver();
        $sender = $event->getSender();
        $content = $event->getContent();
        $object = $event->getObject();
        $withMail = $event->getWithMail();
        $this->messageManager->sendMessageToAbstractRoleSubject(
            $receiver,
            $content,
            $object,
            $sender,
            $withMail
        );
    }
938752
public function onEvent($event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $session = $event->getRequest()->getSession();
        if ($session && $session->isStarted()) {
            $this->attachFlashBag($session);
        }
    }
1151118
private function invokeEvent($event)
    {
        if (array_key_exists($event->type, $this->_eventListeners)) {
            $listeners = $this->_eventListeners [$event->type];
        } else {
            return;
        }
        foreach ($listeners as $listener) {
            sd_call_user_func($listener, $event);
        }
    }
451743
public function handleFlushLive(FlushEvent $event)
    {
        if (count($this->liveDocuments) < 1) {
            return;
        }

        foreach ($this->liveDocuments as $documentData) {
            $document = $this->documentManager->find($documentData['uuid'], $documentData['locale']);
            $this->documentManager->refresh($document);

            $this->liveIndexer->index($document);
        }
        $this->liveIndexer->flush();
        $this->liveDocuments = [];
    }
846782
public function onDeleteRelation($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if ($sender->relationType == static::$relationMutual) {
            $sender->off(static::EVENT_AFTER_DELETE, [$sender, 'onDeleteRelation']);
            static::removeAllRelations($sender->recipient, $sender->initiator);
            $sender->on(static::EVENT_AFTER_DELETE, [$sender, 'onDeleteRelation']);
        }
    }
981394
public function onFailedEventLogToLogger(FailedEvent $event)
    {
        $context = array(
            'event.name' => $event->getLastEventName(),
        );

        $message = 'An unknown error occured.';
        $exception = $event->getException();
        if ($exception instanceof Exception) {
            $message = $exception->getMessage();
        }
        if ($exception instanceof TaskRuntimeException && $exception->getTask() instanceof EventSubscriberInterface) {
            $eventSubscriberClassName = get_class($exception->getTask());
            if (strrpos($eventSubscriberClassName, '\\') !== false) {
                $eventSubscriberClassName = substr($eventSubscriberClassName, strrpos($eventSubscriberClassName, '\\') + 1);
            }
            $context['event.task.name'] = $eventSubscriberClassName;
        }

        $this->logger->log(LogLevel::CRITICAL, $message, $context);
        if ($exception instanceof TaskCommandExecutionException && $exception->getProcessExecutionResult() instanceof ProcessExecutionResult) {
            $context['command.result'] = $exception->getProcessExecutionResult()->getOutput();
            $context['separator'] = "\n=================\n";

            $this->logger->log(LogLevel::DEBUG, "{separator} Command output:{separator}\n{command.result}{separator}", $context);
        }
    }
1289255
public function beforeLog(Event $event, array $logs)
    {
        foreach ($logs as $log) {
            $log->setMetaInfo($log->getMetaInfo() + $this->data);
        }
    }
817162
public function handle(GetGroupHeaderEvent $event)
    {
        if ((null !== $event->getValue()) || !$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $environment = $event->getEnvironment();
        $property    = $environment
            ->getDataDefinition()
            ->getPropertiesDefinition()
            ->getProperty($event->getGroupField());

        // No property? Get out!
        if (!$property) {
            $event->setValue('-');
            return;
        }

        $value = $this->formatGroupHeader(
            $environment,
            $event->getModel(),
            $property,
            $event->getGroupingMode(),
            $event->getGroupingLength()
        );

        if (null !== $value) {
            $event->setValue($value);
        }
    }
990423
public function logEvent(AbstractEvent $event)
    {
        $eventLog = EventLog::addEventEntry($event);

        return $this->repository->save($eventLog);
    }
233602
public function onFlush(OnFlushEventArgs $event)
    {
        $em = $event->getEntityManager();
        $uow = $em->getUnitOfWork();

        foreach ($uow->getScheduledEntityInsertions() as $entity) {
            if ($entity instanceOf ImageInterface) {
                if ($entity->isNew() && !$entity->hasFile()) {
                    $uow->detach($entity);
                }
            }
        }
    }
1069376
public function logMessage(Message $message) {
        foreach($this->logger as $logger) {
            $logger->logMessage($message);
        }
    }