‪TYPO3CMS  9.5
TYPO3\CMS\Core\Log\LogManager Class Reference
Inheritance diagram for TYPO3\CMS\Core\Log\LogManager:
TYPO3\CMS\Core\SingletonInterface TYPO3\CMS\Core\Log\LogManagerInterface

Public Member Functions

 __construct (string $requestId='')
 
 reset ()
 
TYPO3 CMS Core Log Logger getLogger ($name='')
 
 registerLogger ($name)
 
array getLoggerNames ()
 

Public Attributes

const CONFIGURATION_TYPE_WRITER = 'writer'
 
const CONFIGURATION_TYPE_PROCESSOR = 'processor'
 

Protected Member Functions

 setWritersForLogger (Logger $logger)
 
 setProcessorsForLogger (Logger $logger)
 
array getConfigurationForLogger ($configurationType, $loggerName)
 

Protected Attributes

array $loggers = array( )
 
TYPO3 CMS Core Log Logger $rootLogger
 
string $requestId = ''
 

Detailed Description

Global LogManager that keeps track of global logging information.

Inspired by java.util.logging

Definition at line 24 of file LogManager.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Log\LogManager::__construct ( string  $requestId = '')

Constructor

Parameters
string$requestId‪Unique ID of the request

Definition at line 59 of file LogManager.php.

References TYPO3\CMS\Core\Log\LogManager\$requestId, and TYPO3\CMS\Core\Log\LogManager\$rootLogger.

Member Function Documentation

◆ getConfigurationForLogger()

array TYPO3\CMS\Core\Log\LogManager::getConfigurationForLogger (   $configurationType,
  $loggerName 
)
protected

Returns the configuration from $TYPO3_CONF_VARS['LOG'] as hierarchical array for different components of the class hierarchy.

Parameters
string$configurationTypeType of config to return (writer, processor)
string$loggerNameLogger name
Exceptions

Definition at line 185 of file LogManager.php.

References $GLOBALS, and TYPO3\CMS\Core\Log\LogLevel\validateLevel().

Referenced by TYPO3\CMS\Core\Log\LogManager\setProcessorsForLogger(), and TYPO3\CMS\Core\Log\LogManager\setWritersForLogger().

◆ getLogger()

TYPO3 CMS Core Log Logger TYPO3\CMS\Core\Log\LogManager::getLogger (   $name = '')

Gets a logger instance for the given name.

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class)->getLogger('main.sub.subsub');

$name can also be submitted as a underscore-separated string, which will be converted to dots. This is useful to call this method with CLASS as parameter.

Parameters
string$nameLogger name, empty to get the global "root" logger.
Returns
‪\TYPO3\CMS\Core\Log\Logger Logger with name $name

Implements TYPO3\CMS\Core\Log\LogManagerInterface.

Definition at line 86 of file LogManager.php.

References TYPO3\CMS\Core\Log\LogManager\setProcessorsForLogger(), and TYPO3\CMS\Core\Log\LogManager\setWritersForLogger().

◆ getLoggerNames()

array TYPO3\CMS\Core\Log\LogManager::getLoggerNames ( )

For use in unit test context only.

Returns
‪array

Definition at line 121 of file LogManager.php.

◆ registerLogger()

TYPO3\CMS\Core\Log\LogManager::registerLogger (   $name)

For use in unit test context only.

Parameters
string$name

Definition at line 111 of file LogManager.php.

◆ reset()

TYPO3\CMS\Core\Log\LogManager::reset ( )

For use in unit test context only. Resets the internal logger registry.

Definition at line 69 of file LogManager.php.

◆ setProcessorsForLogger()

TYPO3\CMS\Core\Log\LogManager::setProcessorsForLogger ( Logger  $logger)
protected

Appends the processors to the given logger as configured.

Parameters
\TYPO3\CMS\Core\Log\Logger$loggerLogger to configure

Definition at line 158 of file LogManager.php.

References TYPO3\CMS\Core\Log\Logger\addProcessor(), TYPO3\CMS\Core\Log\LogManager\getConfigurationForLogger(), TYPO3\CMS\Core\Log\Logger\getName(), and TYPO3\CMS\Core\Log\Logger\warning().

Referenced by TYPO3\CMS\Core\Log\LogManager\getLogger().

◆ setWritersForLogger()

TYPO3\CMS\Core\Log\LogManager::setWritersForLogger ( Logger  $logger)
protected

Appends the writers to the given logger as configured.

Parameters
\TYPO3\CMS\Core\Log\Logger$loggerLogger to configure

Definition at line 131 of file LogManager.php.

References TYPO3\CMS\Core\Log\Logger\addWriter(), TYPO3\CMS\Core\Log\LogManager\getConfigurationForLogger(), TYPO3\CMS\Core\Log\Logger\getName(), and TYPO3\CMS\Core\Log\Logger\warning().

Referenced by TYPO3\CMS\Core\Log\LogManager\getLogger().

Member Data Documentation

◆ $loggers

array TYPO3\CMS\Core\Log\LogManager::$loggers = array( )
protected

Loggers to retrieve them for repeated use.

Definition at line 40 of file LogManager.php.

◆ $requestId

string TYPO3\CMS\Core\Log\LogManager::$requestId = ''
protected

Unique ID of the request

Definition at line 52 of file LogManager.php.

Referenced by TYPO3\CMS\Core\Log\LogManager\__construct().

◆ $rootLogger

TYPO3 CMS Core Log Logger TYPO3\CMS\Core\Log\LogManager::$rootLogger
protected

Default / global / root logger.

Definition at line 46 of file LogManager.php.

Referenced by TYPO3\CMS\Core\Log\LogManager\__construct().

◆ CONFIGURATION_TYPE_PROCESSOR

const TYPO3\CMS\Core\Log\LogManager::CONFIGURATION_TYPE_PROCESSOR = 'processor'

Definition at line 34 of file LogManager.php.

◆ CONFIGURATION_TYPE_WRITER

const TYPO3\CMS\Core\Log\LogManager::CONFIGURATION_TYPE_WRITER = 'writer'

Definition at line 29 of file LogManager.php.