Bug #48918
closedFileLogWriter ignores log file configuration
100%
Description
If there are several instances of TYPO3\CMS\Core\Log\Writer\FileLogWriter
with different log files configured in $logFile
, all log records end up in one file.
This is caused by improper use of static variable $logFileHandle
. All filehandles except the one of the latest instance are ignored.
Updated by Gerrit Code Review over 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21258
Updated by Steffen Müller over 11 years ago
Steps to reproduce¶
Add some log calls to a file:
$logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger(__CLASS__); $logger->error('my-error'); $logger->debug('my-debug');
Configure logging:
$TYPO3_CONF_VARS['LOG']['writerConfiguration'] = array( \TYPO3\CMS\Core\Log\LogLevel::ERROR => array( 'TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array( 'logFile' => 'typo3temp/logs/error.log' ), ), \TYPO3\CMS\Core\Log\LogLevel::DEBUG => array( 'TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array( 'logFile' => 'typo3temp/logs/debug.log' ), ), );
Expected result¶
$ cat typo3temp/logs/debug.log Thu, 06 Jun 2013 16:29:20 +0200 [ERROR] request="51b09cbec1156" component="...": my-error Thu, 06 Jun 2013 16:29:20 +0200 [DEBUG] request="51b09cbec1156" component="...": my-debug
$ cat typo3temp/logs/error.log Thu, 06 Jun 2013 16:29:20 +0200 [ERROR] request="51b09cbec1156" component="...": my-error
Actual result¶
$ cat typo3temp/logs/debug.log Thu, 06 Jun 2013 16:25:25 +0200 [ERROR] request="51b09bd4a9c19" component="...": my-error Thu, 06 Jun 2013 16:25:25 +0200 [ERROR] request="51b09bd4a9c19" component="...": my-error Thu, 06 Jun 2013 16:25:25 +0200 [DEBUG] request="51b09bd4a9c19" component="...": my-debug
$ cat typo3temp/logs/error.log [EMPTY FILE]
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21258
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21258
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21258
Updated by Gerrit Code Review over 11 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21258
Updated by Gerrit Code Review over 11 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21258
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21324
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/21325
Updated by Steffen Müller over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 34dc73da8fa92e31926ee6f4cfdaaef9ff3044fe.