PHP code example of mteu / typo3-stream-writer

1. Go to this page and download the library: Download mteu/typo3-stream-writer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mteu / typo3-stream-writer example snippets


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



declare(strict_types=1);

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


defined('TYPO3') or die();

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