Back to SyslogLogger class

Method addEntry

public void
addEntry
(\Joomla\CMS\Log\LogEntry $entry)
Method to add an entry to the log.
Parameters
  • \Joomla\CMS\Log\LogEntry $entry The log entry object to add to the log.
Returns
  • void
Since
  • 1.7.0
Class: SyslogLogger
Project: Joomla

Method addEntry - Source code

/**
 * 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)
{
    // Generate the value for the priority based on predefined constants.
    $priority = \constant(strtoupper('LOG_' . $this->priorities[$entry->priority]));
    // Send the entry to Syslog.
    syslog($priority, '[' . $entry->category . '] ' . $entry->message);
}