ssch/t3-psr3-log-processor
最新稳定版本:v1.0.0
Composer 安装命令:
composer require ssch/t3-psr3-log-processor
包简介
Provide PSR-3 interpolate log processor
README 文档
README
https://www.php-fig.org/psr/psr-3/#12-message
Integration guide
The extension ships with a custom Processor to substitute log messages with context variables in the message. Let´s say you have a log message with the following format:
use Psr\Log\LogLevel;use TYPO3\CMS\Core\Log\LogRecord; $logRecord = new LogRecord('foo', LogLevel::INFO, 'A message with a {placeholder}', ['placeholder' => 'bar']);
In that case the {placeholder} of the message will be substituted by "bar" when processed by the PsrLogProcessor shipped with the extension.
In order to activate the Processor you can configure it i.e. via ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['LOG']['Documentation']['Examples']['Controller']['processorConfiguration'] = [ // configuration for Debug level log entries and above \TYPO3\CMS\Core\Log\LogLevel::DEBUG => [ \Ssch\Psr3LogProcessor\Processor\PsrLogMessageProcessor::class => [ // The format of the timestamp: one supported by DateTime::format 'dateFormat' => DateTime::ISO8601, // If set to true the fields interpolated into message gets unset 'removeUsedContextFields' => true, // Arrays will be json encoded. With this option you can define how this will happen 'jsonFlags' => JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ] ] ];
Credits
This LogProcessor is heavily inspired by the Processor of monolog/monolog
统计信息
- 总下载量: 3.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2023-03-16