TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
Logger Class Reference
Inheritance diagram for Logger:

Public Member Functions

 __construct ($name)
 
 getName ()
 
 addWriter ($minimumLevel, Writer\WriterInterface $writer)
 
 getWriters ()
 
 addProcessor ($minimumLevel, Processor\ProcessorInterface $processor)
 
 getProcessors ()
 
 emergency ($message, array $data=[])
 
 alert ($message, array $data=[])
 
 critical ($message, array $data=[])
 
 error ($message, array $data=[])
 
 warning ($message, array $data=[])
 
 notice ($message, array $data=[])
 
 info ($message, array $data=[])
 
 debug ($message, array $data=[])
 

Protected Member Functions

 setMinimumLogLevel ($level)
 
 getMinimumLogLevel ()
 
 callProcessors (LogRecord $record)
 
 writeLog (LogRecord $record)
 

Protected Attributes

 $name = ''
 
 $minimumLogLevel = LogLevel::EMERGENCY
 
 $writers = []
 
 $processors = []
 

Detailed Description

Logger to log events and data for different components.

Definition at line 20 of file Logger.php.

Constructor & Destructor Documentation

__construct (   $name)

Constructor.

Parameters
string$nameA name for the logger.
Returns

Definition at line 59 of file Logger.php.

References Logger\$name.

Member Function Documentation

addProcessor (   $minimumLevel,
Processor\ProcessorInterface  $processor 
)

Adds a processor to the logger.

Parameters
int$minimumLevel
\TYPO3\CMS\Core\Log\Processor\ProcessorInterface$processorThe processor to add.
Returns
void

Definition at line 138 of file Logger.php.

References LogLevel\EMERGENCY, Logger\getMinimumLogLevel(), Logger\setMinimumLogLevel(), and LogLevel\validateLevel().

addWriter (   $minimumLevel,
Writer\WriterInterface  $writer 
)

Adds a writer to this logger

Parameters
int$minimumLevel
\TYPO3\CMS\Core\Log\Writer\WriterInterface$writerWriter object
Returns
$this

Definition at line 104 of file Logger.php.

References LogLevel\EMERGENCY, Logger\getMinimumLogLevel(), Logger\setMinimumLogLevel(), and LogLevel\validateLevel().

alert (   $message,
array  $data = [] 
)

Shortcut to log an ALERT record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 241 of file Logger.php.

References LogLevel\ALERT.

callProcessors ( LogRecord  $record)
protected

Calls all processors and returns log record

Parameters
\TYPO3\CMS\Core\Log\LogRecord$recordRecord to process
Exceptions
RuntimeException
Returns
Processed log record

Definition at line 193 of file Logger.php.

References LogRecord\getLevel().

critical (   $message,
array  $data = [] 
)

Shortcut to log a CRITICAL record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 253 of file Logger.php.

References LogLevel\CRITICAL.

debug (   $message,
array  $data = [] 
)

Shortcut to log a DEBUG record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 313 of file Logger.php.

References LogLevel\DEBUG.

emergency (   $message,
array  $data = [] 
)

Shortcut to log an EMERGENCY record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 229 of file Logger.php.

References LogLevel\EMERGENCY.

error (   $message,
array  $data = [] 
)

Shortcut to log an ERROR record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 265 of file Logger.php.

References LogLevel\ERROR.

getMinimumLogLevel ( )
protected

Gets the minimum log level for which log records are written.

Returns
int Minimum log level

Definition at line 82 of file Logger.php.

References Logger\$minimumLogLevel.

Referenced by Logger\addProcessor(), and Logger\addWriter().

getName ( )

Gets the logger's name.

Returns
string Logger name.

Definition at line 92 of file Logger.php.

References Logger\$name.

getProcessors ( )

Returns all added processors indexed by log level

Returns
array

Definition at line 159 of file Logger.php.

References Logger\$processors.

getWriters ( )

Returns all configured writers indexed by log level

Returns
array

Definition at line 126 of file Logger.php.

References Logger\$writers.

info (   $message,
array  $data = [] 
)

Shortcut to log an INFORMATION record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 301 of file Logger.php.

References LogLevel\INFO.

notice (   $message,
array  $data = [] 
)

Shortcut to log a NOTICE record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 289 of file Logger.php.

References LogLevel\NOTICE.

setMinimumLogLevel (   $level)
protected

Sets the minimum log level for which log records are written.

Parameters
int$levelMinimum log level
Returns
$this

Definition at line 70 of file Logger.php.

References LogLevel\validateLevel().

Referenced by Logger\addProcessor(), and Logger\addWriter().

warning (   $message,
array  $data = [] 
)

Shortcut to log a WARNING record.

Parameters
string$messageLog message.
array$dataAdditional data to log
Returns
$this

Definition at line 277 of file Logger.php.

References LogLevel\WARNING.

writeLog ( LogRecord  $record)
protected

Passes the to all registered writers.

Parameters
\TYPO3\CMS\Core\Log\LogRecord$record
Returns
void

Definition at line 213 of file Logger.php.

References LogRecord\getLevel().

Member Data Documentation

$minimumLogLevel = LogLevel::EMERGENCY
protected

Definition at line 37 of file Logger.php.

Referenced by Logger\getMinimumLogLevel().

$name = ''
protected

Definition at line 30 of file Logger.php.

Referenced by Logger\__construct(), and Logger\getName().

$processors = []
protected

Definition at line 51 of file Logger.php.

Referenced by Logger\getProcessors().

$writers = []
protected

Definition at line 44 of file Logger.php.

Referenced by Logger\getWriters().