Project

General

Profile

Actions

Bug #48918

closed

FileLogWriter ignores log file configuration

Added by Steffen Müller almost 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Logging
Target version:
-
Start date:
2013-06-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Gerrit Code Review almost 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

Actions #2

Updated by Steffen Müller almost 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]
Actions #3

Updated by Gerrit Code Review almost 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

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Gerrit Code Review almost 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

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Steffen Müller almost 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF