SetupComponent::log404()

@param bool $notifyAdminOnInternalErrors
@return void
13456
public function log404($notifyAdminOnInternalErrors = false) {
		if ($this->Controller->name === 'CakeError') {
			$referer = $this->Controller->referer();
			$this->Controller->log('REF: ' . $referer . ' - URL: ' . $this->Controller->request->url, '404');
		}
	}
163926
function (notifyText) {
			this.writeDebug('notify',notifyText);
			if (this.settings.callbackNotify) {
				this.settings.callbackNotify.call(this, notifyText);
			}
			else {
				alert(notifyText);
			}
		}
1309184
public function onLog(LogGenericEvent $event)
    {
        if ($event instanceof NotifiableInterface && $this->ch->getParameter('is_notification_active')) {
            $workspace = $event->getWorkspace();
            if ($event->isAllowedToNotify() &&
                (null === $workspace || (null !== $workspace && !$workspace->isDisabledNotifications()))
            ) {
                $this->notificationManager->createNotificationAndNotify($event);
            }
        }
    }
849544
def log_warn(message, args):
    """"""
    get_logger(DEFAULT_LOGGER, log_creation=False).log(logging.WARNING, message, *args)
1100611
protected function cron_notify(array $notifications) {
        global $CFG;

        if (empty($notifications)) {
            $this->cron_mtrace('nothing to notify about. ', '');
            return;
        }

        $admins = get_admins();

        if (empty($admins)) {
            return;
        }

        $this->cron_mtrace('sending notifications ... ', '');

        $text = get_string('updatenotifications', 'core_admin') . PHP_EOL;
        $html = html_writer::tag('h1', get_string('updatenotifications', 'core_admin')) . PHP_EOL;

        $coreupdates = array();
        $pluginupdates = array();

        foreach ($notifications as $notification) {
            if ($notification->component == 'core') {
                $coreupdates[] = $notification;
            } else {
                $pluginupdates[] = $notification;
            }
        }

        if (!empty($coreupdates)) {
            $text .= PHP_EOL . get_string('updateavailable', 'core_admin') . PHP_EOL;
            $html .= html_writer::tag('h2', get_string('updateavailable', 'core_admin')) . PHP_EOL;
            $html .= html_writer::start_tag('ul') . PHP_EOL;
            foreach ($coreupdates as $coreupdate) {
                $html .= html_writer::start_tag('li');
                if (isset($coreupdate->release)) {
                    $text .= get_string('updateavailable_release', 'core_admin', $coreupdate->release);
                    $html .= html_writer::tag('strong', get_string('updateavailable_release', 'core_admin', $coreupdate->release));
                }
                if (isset($coreupdate->version)) {
                    $text .= ' '.get_string('updateavailable_version', 'core_admin', $coreupdate->version);
                    $html .= ' '.get_string('updateavailable_version', 'core_admin', $coreupdate->version);
                }
                if (isset($coreupdate->maturity)) {
                    $text .= ' ('.get_string('maturity'.$coreupdate->maturity, 'core_admin').')';
                    $html .= ' ('.get_string('maturity'.$coreupdate->maturity, 'core_admin').')';
                }
                $text .= PHP_EOL;
                $html .= html_writer::end_tag('li') . PHP_EOL;
            }
            $text .= PHP_EOL;
            $html .= html_writer::end_tag('ul') . PHP_EOL;

            $a = array('url' => $CFG->wwwroot.'/'.$CFG->admin.'/index.php');
            $text .= get_string('updateavailabledetailslink', 'core_admin', $a) . PHP_EOL;
            $a = array('url' => html_writer::link($CFG->wwwroot.'/'.$CFG->admin.'/index.php', $CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
            $html .= html_writer::tag('p', get_string('updateavailabledetailslink', 'core_admin', $a)) . PHP_EOL;

            $text .= PHP_EOL . get_string('updateavailablerecommendation', 'core_admin') . PHP_EOL;
            $html .= html_writer::tag('p', get_string('updateavailablerecommendation', 'core_admin')) . PHP_EOL;
        }

        if (!empty($pluginupdates)) {
            $text .= PHP_EOL . get_string('updateavailableforplugin', 'core_admin') . PHP_EOL;
            $html .= html_writer::tag('h2', get_string('updateavailableforplugin', 'core_admin')) . PHP_EOL;

            $html .= html_writer::start_tag('ul') . PHP_EOL;
            foreach ($pluginupdates as $pluginupdate) {
                $html .= html_writer::start_tag('li');
                $text .= get_string('pluginname', $pluginupdate->component);
                $html .= html_writer::tag('strong', get_string('pluginname', $pluginupdate->component));

                $text .= ' ('.$pluginupdate->component.')';
                $html .= ' ('.$pluginupdate->component.')';

                $text .= ' '.get_string('updateavailable', 'core_plugin', $pluginupdate->version);
                $html .= ' '.get_string('updateavailable', 'core_plugin', $pluginupdate->version);

                $text .= PHP_EOL;
                $html .= html_writer::end_tag('li') . PHP_EOL;
            }
            $text .= PHP_EOL;
            $html .= html_writer::end_tag('ul') . PHP_EOL;

            $a = array('url' => $CFG->wwwroot.'/'.$CFG->admin.'/plugins.php');
            $text .= get_string('updateavailabledetailslink', 'core_admin', $a) . PHP_EOL;
            $a = array('url' => html_writer::link($CFG->wwwroot.'/'.$CFG->admin.'/plugins.php', $CFG->wwwroot.'/'.$CFG->admin.'/plugins.php'));
            $html .= html_writer::tag('p', get_string('updateavailabledetailslink', 'core_admin', $a)) . PHP_EOL;
        }

        $a = array('siteurl' => $CFG->wwwroot);
        $text .= PHP_EOL . get_string('updatenotificationfooter', 'core_admin', $a) . PHP_EOL;
        $a = array('siteurl' => html_writer::link($CFG->wwwroot, $CFG->wwwroot));
        $html .= html_writer::tag('footer', html_writer::tag('p', get_string('updatenotificationfooter', 'core_admin', $a),
            array('style' => 'font-size:smaller; color:#333;')));

        foreach ($admins as $admin) {
            $message = new \core\message\message();
            $message->courseid          = SITEID;
            $message->component         = 'moodle';
            $message->name              = 'availableupdate';
            $message->userfrom          = get_admin();
            $message->userto            = $admin;
            $message->subject           = get_string('updatenotificationsubject', 'core_admin', array('siteurl' => $CFG->wwwroot));
            $message->fullmessage       = $text;
            $message->fullmessageformat = FORMAT_PLAIN;
            $message->fullmessagehtml   = $html;
            $message->smallmessage      = get_string('updatenotifications', 'core_admin');
            $message->notification      = 1;
            message_send($message);
        }
    }
727077
public function log($message, $type = PHP_COMPONENT_MESSAGE_INFO, $internal = false) {
		$message = '[' . date('H:i:s', time()) . ($internal ? '] <core> ' : '] <app> ') . "$message\n";
		switch($this->logging_mode) {
			case PHP_COMPONENT_LOG_FILE:
				if(is_null($this->log_file)) {
					$this->log_file = @ fopen($this->log_filename, 'a');
					@ ftruncate($this->log_file, 0);
					@ flock($this->log_file, LOCK_EX);
				}
				@ fputs($this->log_file, $message);
			break;
			case PHP_COMPONENT_LOG_SYSLOG:
				// TODO
			break;
			case PHP_COMPONENT_LOG_CONSOLE:
				if(strtolower(php_uname('s')) == 'linux') {
					switch($type) {
						case PHP_COMPONENT_MESSAGE_INFO:
							echo "\033[22;37m$message\033[0m";
						break;
						case PHP_COMPONENT_MESSAGE_WARNING:
							echo "\033[01;33m$message\033[0m";
						break;
						case PHP_COMPONENT_MESSAGE_ERROR:
							echo "\033[22;31m$message\033[0m";
						break;
					}
				} else {
					echo $message;
				}
			break;
		}
	}
871995
function logError( $message, array $more_info = [] ) {

		$more_info['path'] = $this->outputPath;

		parent::logError( $message, $more_info );
	}
469544
public function logNotification()
    {
        try {
            $this->logNotificationContents();
            $this->ipnLogFile->writeLine("=============================================================================");
            $this->ipnLogFile->closeFile();
        } catch (Exception $ex){
            error_log($ex->getMessage());
        } 
    }
615455
public function errorLog($type = 'debug', $messageType = ErrorLogHandler::OPERATING_SYSTEM)
    {
        $this->pushHandler(new ErrorLogHandler($messageType, $this->getLevel($type)));
    }
756593
public function logNotificationInput($paramsArray) {
    $this->writeLog(sprintf($this->debugStrings['notifyInput'], date('Y-m-d H:i:s'), print_r($paramsArray, 1)));
  }
1003190
public static function error(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('error')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::ERROR)) {
                    $adapter->error((new Message(self::ERROR))->setMessages($messages));
                }
            }
        }
    }
940128
public static function setEnvironment(): void
    {
        error_reporting(E_ALL);
        set_error_handler(function ($errno, $errstr, $errfile, $errline, array $errcontext): bool {
            if (!(error_reporting() & $errno)) {
                // respect error_reporting() level
                // libraries used in custom components may emit notices that cannot be fixed
                return false;
            }

            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
        });
    }
225319
public function logging( $log = false )
    {
        if ( $log !== false ) {
            if ( ! ini_get('log_errors') ) {
                ini_set('log_errors', true);
            }
            if ( ! ini_get('error_log') ) {
                ini_set('error_log', $log);
            }
        }
    }
639849
public function addLogEntry(\JLogEntry $entry)
    {
        if ($this->logger !== null) {
            $level = $entry->priority;
            $message = $entry->message;
            $context = [];

            switch (true) {
                case $level <= Log::EMERGENCY:
                    $this->logger->emergency($message, $context);
                    break;
                case $level <= Log::ALERT:
                    $this->logger->alert($message, $context);
                    break;
                case $level <= Log::CRITICAL:
                    $this->logger->critical($message, $context);
                    break;
                case $level <= Log::ERROR:
                    $this->logger->error($message, $context);
                    break;
                case $level <= Log::WARNING:
                    $this->logger->warning($message, $context);
                    break;
                case $level <= Log::NOTICE:
                    $this->logger->notice($message, $context);
                    break;
                case $level <= Log::INFO:
                    $this->logger->info($message, $context);
                    break;
                case $level <= Log::DEBUG:
                default:
                    $this->logger->debug($message, $context);
                    break;
            }
        }
    }
672291
public function markAsSeen(NotifiableInterface $notifiable, NotificationInterface $notification, $flush = false)
    {
        $nn = $this->getNotifiableNotification($notifiable, $notification);
        if ($nn) {
            $nn->setSeen(true);
            $event = new NotificationEvent($notification, $notifiable);
            $this->dispatcher->dispatch(MgiletNotificationEvents::SEEN, $event);
            $this->flush($flush);
        } else {
            throw new EntityNotFoundException('The link between the notifiable and the notification has not been found');
        }
    }
73411
public function activate( $model, $notify = true, $config = [] ) {

		if( !$model->isActive( true ) ) {

			$oldStatus = $model->getStatusStr();

			$model = $this->updateStatus( $model, IApproval::STATUS_ACTIVE );

			$newStatus = $model->getStatusStr();

			if( $notify ) {

				$title = ucfirst( self::$parentType ) . ' - ' . $model->getClassName() . ' - Activated';

				$config[ 'template' ] = CoreGlobal::TPL_NOTIFY_STATUS_ACTIVE;

				$config[ 'data' ][ 'oldStatus' ] = $oldStatus;
				$config[ 'data' ][ 'newStatus' ] = $newStatus;

				$this->notifyUser( $model, $config, $title );
			}

			return $model;
		}

		return false;
	}
1277107
public function alert(string $message, array $context = []){
        if($this->logger !== null){
            $this->logger->alert($message, $context);
        }

        if($this->messagePanel !== null){
            $this->messagePanel->addMessage($message, LogLevel::ALERT);
        }
    }