Review main Merged

21258[BUGFIX] FileLogWriter ignores log file configuration

Steffen Müller CR +2 V +2 Normal +69 −25 updated 06/10/13, 15:59

Commit message

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.

Review

  • Code review CR +2
    • Markus Klein +2
    • Helmut Hummel +1
  • Verified V +2
    • Markus Klein +2
    • Helmut Hummel +1

Issues 1

Files 2

Review log 28

Show 3 earlier messages
  1. Mr. Jenkins commented on patch set 1 06/06/13, 13:47

  2. Steffen Gebert commented on patch set 1 06/06/13, 14:19

    I'm not so sure.. I believe the reason why this is a static variable was to not open the file multiple times, but I see the problem caused by this. Is there one FileLogWriter instance only per log file? Or is always a new one created, when a FileLogWriter for a certain file is requested? If there's only one, I see no problem in removing this. Otherwise we might make the static variable an array and hold the handle on a per-logfile basis.
  3. Steffen Müller commented on patch set 1 06/06/13, 14:54

    I see. What would you use as kay? the path or a hash of it?
  1. Steffen Müller uploaded patch set 2 06/06/13, 15:17

  2. Mr. Jenkins commented on patch set 2 06/06/13, 15:18

  3. Alexander Opitz voted on patch set 2 CR +1 06/07/13, 10:07

  4. Steffen Müller commented on patch set 2 06/07/13, 12:09

    I did not test if a file is served by just one filehandle within a request. This should be done before merging.
  5. Steffen Müller uploaded patch set 3 06/08/13, 12:49

  6. Mr. Jenkins commented on patch set 3 06/08/13, 12:50

  7. Alexander Opitz voted on patch set 3 CR +1 06/08/13, 22:11

  8. Helmut Hummel voted on patch set 3 CR +1 06/10/13, 09:18

  9. Markus Klein commented on patch set 3 06/10/13, 09:21

    FileWriter.php:100

    Move this check into the openLogFile() method.
  10. Helmut Hummel commented on patch set 3 06/10/13, 09:30

    FileWriter.php:100 Reply

    good idea
  11. Steffen Müller commented on patch set 3 06/10/13, 10:03

    FileWriter.php:100 Reply

    why? would result in one more superfluous function call
  12. Steffen Müller uploaded patch set 4 06/10/13, 10:28

  13. Mr. Jenkins commented on patch set 4 06/10/13, 10:29

  14. Markus Klein voted on patch set 4 CR +2 06/10/13, 10:59

  15. Helmut Hummel commented on patch set 4 CR -1 06/10/13, 13:37

    will create tests for this one
  16. Helmut Hummel commented on patch set 4 V -1 06/10/13, 14:14

    FileWriter.php:136

    Must be "$this->logFile" !
  17. Helmut Hummel uploaded patch set 5 06/10/13, 14:14

  18. Mr. Jenkins commented on patch set 5 06/10/13, 14:15

  19. Helmut Hummel uploaded patch set 6 06/10/13, 14:17

  20. Mr. Jenkins commented on patch set 6 06/10/13, 14:17

  21. Helmut Hummel voted on patch set 6 V +1 CR +1 06/10/13, 14:18

  22. Markus Klein commented on patch set 6 CR +2 06/10/13, 15:12

    Thx Helmut.
  23. Steffen Müller commented on patch set 6 06/10/13, 15:56

    Wow - I didn't know this kind of unitTest was possilbe. Thanks for that. I have green bar! AFAIK a +1 verified is missing.
  24. Markus Klein commented on patch set 6 V +2 06/10/13, 15:59

    You got my verified
  25. Markus Klein merged patch set 7 06/10/13, 15:59