TYPO3 CMS  TYPO3_6-2
TYPO3\Flow\Log\LoggerInterface Interface Reference
Inheritance diagram for TYPO3\Flow\Log\LoggerInterface:
TYPO3\Flow\Log\SystemLoggerInterface

Public Member Functions

 addBackend (\TYPO3\Flow\Log\Backend\BackendInterface $backend)
 
 removeBackend (\TYPO3\Flow\Log\Backend\BackendInterface $backend)
 
 log ($message, $severity=LOG_INFO, $additionalData=NULL, $packageKey=NULL, $className=NULL, $methodName=NULL)
 
 logException (\Exception $exception, array $additionalData=array())
 

Detailed Description

Contract for a basic logger interface

The severities are (according to RFC3164) the PHP constants: LOG_EMERG # Emergency: system is unusable LOG_ALERT # Alert: action must be taken immediately LOG_CRIT # Critical: critical conditions LOG_ERR # Error: error conditions LOG_WARNING # Warning: warning conditions LOG_NOTICE # Notice: normal but significant condition LOG_INFO # Informational: informational messages LOG_DEBUG # Debug: debug-level messages

Definition at line 29 of file LoggerInterface.php.

Member Function Documentation

◆ addBackend()

TYPO3\Flow\Log\LoggerInterface::addBackend ( \TYPO3\Flow\Log\Backend\BackendInterface  $backend)

Adds a backend to which the logger sends the logging data

Parameters
\TYPO3\Flow\Log\Backend\BackendInterface$backendA backend implementation
Returns
void

◆ log()

TYPO3\Flow\Log\LoggerInterface::log (   $message,
  $severity = LOG_INFO,
  $additionalData = NULL,
  $packageKey = NULL,
  $className = NULL,
  $methodName = NULL 
)

Writes the given message along with the additional information into the log.

Parameters
string$messageThe message to log
integer$severityAn integer value, one of the LOG_* constants
mixed$additionalDataA variable containing more information about the event to be logged
string$packageKeyKey of the package triggering the log (determined automatically if not specified)
string$classNameName of the class triggering the log (determined automatically if not specified)
string$methodNameName of the method triggering the log (determined automatically if not specified)
Returns
void

◆ logException()

TYPO3\Flow\Log\LoggerInterface::logException ( \Exception  $exception,
array  $additionalData = array() 
)

Writes information about the given exception into the log.

Parameters
\Exception$exceptionThe exception to log
array$additionalDataAdditional data to log
Returns
void

◆ removeBackend()

TYPO3\Flow\Log\LoggerInterface::removeBackend ( \TYPO3\Flow\Log\Backend\BackendInterface  $backend)

Runs the close() method of a backend and removes the backend from the logger.

Parameters
\TYPO3\Flow\Log\Backend\BackendInterface$backendThe backend to remove
Returns
void
Exceptions