‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Log\Writer\AbstractWriter Class Reference
Inheritance diagram for TYPO3\CMS\Core\Log\Writer\AbstractWriter:
TYPO3\CMS\Core\Log\Writer\WriterInterface TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter TYPO3\CMS\Core\Log\Writer\DatabaseWriter TYPO3\CMS\Core\Log\Writer\FileWriter TYPO3\CMS\Core\Log\Writer\NullWriter TYPO3\CMS\Core\Log\Writer\PhpErrorLogWriter TYPO3\CMS\Core\Log\Writer\SyslogWriter TYPO3\CMS\Core\Tests\Unit\Log\Fixtures\WriterFixture TYPO3\CMS\Core\Log\Writer\RotatingFileWriter

Public Member Functions

 __construct (array $options=[])
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Log\Writer\WriterInterface
TYPO3 CMS Core Log Writer WriterInterface writeLog (LogRecord $record)
 

Protected Member Functions

 interpolate (string $message, array $context=[])
 
 formatContextValue (string $value)
 
 formatException (\Throwable $ex)
 

Detailed Description

Abstract implementation of a log writer

Definition at line 24 of file AbstractWriter.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Log\Writer\AbstractWriter::__construct ( array  $options = [])

Constructs this log writer

Parameters
array$optionsConfiguration options - depends on the actual log writer
Exceptions

Reimplemented in TYPO3\CMS\Core\Log\Writer\FileWriter, and TYPO3\CMS\Core\Log\Writer\RotatingFileWriter.

Definition at line 34 of file AbstractWriter.php.

Member Function Documentation

◆ formatContextValue()

TYPO3\CMS\Core\Log\Writer\AbstractWriter::formatContextValue ( string  $value)
protected

Escape or quote a value from the context appropriate for the output.

Note: In some output cases, escaping should not be done here but later on output, such as if it's being written to a database for later display.

Parameters
string$value

Definition at line 71 of file AbstractWriter.php.

Referenced by TYPO3\CMS\Core\Log\Writer\AbstractWriter\interpolate().

◆ formatException()

TYPO3\CMS\Core\Log\Writer\AbstractWriter::formatException ( \Throwable  $ex)
protected

Formats an exception into a string.

The format here is nearly the same as just casting an exception to a string, but omits the full class namespace and stack trace, as those get very long.

Definition at line 82 of file AbstractWriter.php.

Referenced by TYPO3\CMS\Core\Log\Writer\SyslogWriter\getMessageForSyslog(), TYPO3\CMS\Core\Log\Writer\PhpErrorLogWriter\writeLog(), and TYPO3\CMS\Core\Log\Writer\FileWriter\writeLog().

◆ interpolate()

TYPO3\CMS\Core\Log\Writer\AbstractWriter::interpolate ( string  $message,
array  $context = [] 
)
protected

Interpolates context values into the message placeholders.

Definition at line 49 of file AbstractWriter.php.

References TYPO3\CMS\Core\Log\Writer\AbstractWriter\formatContextValue().

Referenced by TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter\writeLog().