Pop\Log\Logger::notice PHP Method

notice() public method

Method to add a NOTICE log entry
public notice ( mixed $message, array $options = [] ) : Logger
$message mixed
$options array
return Logger
    public function notice($message, array $options = array())
    {
        return $this->log(self::NOTICE, $message, $options);
    }

Usage Example

Example #1
0
 /**
  * Log a user login
  *
  * @param \Phire\Table\UserTypes $type
  * @param \Phire\Table\Users     $user
  * @return void
  */
 protected function log($type, $user)
 {
     $exclude = array();
     if ($type->log_exclude != '') {
         $exclude = explode(',', $type->log_exclude);
     }
     $domain = str_replace('www.', '', $_SERVER['HTTP_HOST']);
     if (!in_array($_SERVER['REMOTE_ADDR'], $exclude)) {
         $emails = explode(',', $type->log_emails);
         $noreply = Table\Config::findById('reply_email')->value;
         $options = array('subject' => 'Phire CMS ' . ucfirst(strtolower($type->type)) . ' ' . $this->i18n->__('Login Notification') . ' (' . $domain . ')', 'headers' => array('From' => $noreply . ' <' . $noreply . '>', 'Reply-To' => $noreply . ' <' . $noreply . '>'));
         $msg = $this->i18n->__('Someone has logged in as a %1 from %2 using %3.', array(strtolower($type->type), $_SERVER['REMOTE_ADDR'], $user->username));
         $logger = new Log\Logger(new Log\Writer\Mail($emails));
         $logger->notice($msg, $options);
     }
 }
All Usage Examples Of Pop\Log\Logger::notice