4
votes

in the logfile in typo3temp/var/log i can find warnings like this:

Fri, 15 May 2020 22:34:48 +0200 [WARNING] request="6010017cd88f6" 
component="TYPO3.CMS.Frontend.Controller.TypoScriptFrontendController": $TSFE->set_no_cache() 
was triggered. Reason: config.no_cache is set. Caching is disabled!

This warnings are only in this logfile not in the log in the backend of typo3. In the settings of TYPO3 i has chosen the preset "Live" as Debug Settings. In former versions of TYPO3 this setting garantied that no logfile was written.

How can i disable the output of warnings in the logfile?

TYPO3 9.5.17

Thanks!

2

2 Answers

0
votes

To be sure, check your current configuration. In the backend: Configuration > $GLOBALS['TYPO3_CONF_VARS'] > LOG.

If it looks something like this

LOG/
└── writerConfiguration
    └── 4
        └── TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter

You are using LogLevel 4, which is WARNING, you probably want to be using 3, which is ERROR. The LogLevels are in typo3/sysext/core/Classes/Log/LogLevel.php,

This is how you can change the configuration in AdditionalConfiguration.php:

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'] = [
  \TYPO3\CMS\Core\Log\LogLevel::ERROR => [
        \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
            'logFile' => 'path of log file ....'
        ]
  ]
];

(BTW, if you are using a non-Composer based installation, you can still configure the logging to be logged to a file outside of the webroot).

Documentation: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Logging/Configuration/Index.html

You can see the default setting for the logging framework in the file typo3/sysext/core/Configuration/DefaultConfiguration.php:

You can see that the default is in fact WARNING:

'LOG' => [
        'writerConfiguration' => [
            \TYPO3\CMS\Core\Log\LogLevel::WARNING => [
                \TYPO3\CMS\Core\Log\Writer\FileWriter::class => []
            ]
        ],

The "Live" preset sets:

['BE']['debug'] = false;
['FE']['debug'] = false;
['SYS']['devIPmask'] = '';
['SYS']['displayErrors'] = 0;
['SYS']['systemLogLevel'] = 2; // 2 means warning

AFAIK, none of this influences the logs written by the Logging Framework. You may want to change systemLogLevel for logging to the sys_log table though.

0
votes

Manipulate following parameter from settings in backend according to error logging you need at Administration log (sys_log table)

[SYS][beLogErrorReporting]

enter image description here

For disabling log to be written in file , you need to use following in AdditionalConfiguration.php

Where you can set it via different constant, here i've disabled warning

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][\TYPO3\CMS\Core\Log\LogLevel::WARNING] = [];