mteu/typo3-stream-writer

此扩展增加了将日志记录到 php://stdout` 和 php://stderr` 的功能

安装: 69

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 4

类型:typo3-cms-extension

0.3.2 2024-09-17 12:13 UTC

README

TYPO3 12 TYPO3 13 CGL Tests Coverage Status Maintainability

TYPO3 Stream Writer 📜

此TYPO3 CMS扩展向TYPO3日志框架添加了一个自定义的 LogWriter,允许CMS将消息记录到 php://stdoutphp://stderr

⚡️ 快速开始

安装

composer require mteu/typo3-stream-writer

使用

配置您的扩展或TYPO3实例以使用新的写入器。

# config/system/additional.php | typo3conf/system/additional.php

<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Log\LogLevel;
use mteu\StreamWriter\Config\StandardStream;
use mteu\StreamWriter\Writer\StreamWriter;


defined('TYPO3') or die();

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'] = [
     \Psr\Log\LogLevel::ERROR => [
        StreamWriter::class => [
            'outputStream' => StandardStream::Error,
            'ignoredComponents' => [
                BackendUserAuthentication::class,
            ]
        ],
    ],
    \Psr\Log\LogLevel::DEBUG => [
        StreamWriter::class => [
            'outputStream' => StandardStream::Out,
            'ignoredComponents' => [
                'TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication',
                'TYPO3.CMS.Frontend.Authentication.FrontendUserAuthentication',

            ],
            'maxLevel' => Psr\Log\LogLevel::WARNING,
        ],
    ],
];

💡 在 WriterConfiguration 中了解更多关于LogWriter配置的信息。

⭐ 许可证

本项目受 GNU通用公共许可证3.0(或更高版本) 许可。