- md5
- a9996afb94aa1f57932057f18ba21083
- sha1
- 346c9713d5aaf12438019be2c57a433b1bdcd7ab
- sha256
- 3567afb241c0db20af3f5eb47c2a569678f94cdf26c4b79d71cc47201d308846
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Log\Logger;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Log\LogEntry;
use Joomla\CMS\Log\Logger;
/**
* Joomla MessageQueue logger class.
*
* This class is designed to output logs to a specific MySQL database table. Fields in this
* table are based on the Syslog style of log output. This is designed to allow quick and
* easy searching.
*
* @since 1.7.0
*/
class MessagequeueLogger extends Logger
{
/**
* Method to add an entry to the log.
*
* @param LogEntry $entry The log entry object to add to the log.
*
* @return void
*
* @since 1.7.0
*/
public function addEntry(LogEntry $entry)
{
switch ($entry->priority)
{
case Log::EMERGENCY:
case Log::ALERT:
case Log::CRITICAL:
case Log::ERROR:
\JFactory::getApplication()->enqueueMessage($entry->message, 'error');
break;
case Log::WARNING:
\JFactory::getApplication()->enqueueMessage($entry->message, 'warning');
break;
case Log::NOTICE:
\JFactory::getApplication()->enqueueMessage($entry->message, 'notice');
break;
case Log::INFO:
\JFactory::getApplication()->enqueueMessage($entry->message, 'message');
break;
default:
// Ignore other priorities.
break;
}
}
}
The same content is in 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.