- md5
- 214b86f48beba5dc422f14eedaa98a79
- sha1
- 9c2e69bb01dfa2bc833034cfcc163713bd899f2a
- sha256
- 918f09f17731d465c3d43cd155806b22330027e433930fde4b5974e4cd4b0267
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Log\Logger;
use Joomla\CMS\Factory;
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:
Factory::getApplication()->enqueueMessage($entry->message, 'error');
break;
case Log::WARNING:
Factory::getApplication()->enqueueMessage($entry->message, 'warning');
break;
case Log::NOTICE:
Factory::getApplication()->enqueueMessage($entry->message, 'notice');
break;
case Log::INFO:
Factory::getApplication()->enqueueMessage($entry->message, 'message');
break;
default:
// Ignore other priorities.
break;
}
}
}
The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.