[BUGFIX] Add missing logger names 55/26755/3
authorSteffen Müller <typo3@t3node.com>
Sat, 11 Jan 2014 11:14:41 +0000 (12:14 +0100)
committerSteffen Müller <typo3@t3node.com>
Sat, 11 Jan 2014 19:22:11 +0000 (20:22 +0100)
A logger name is mandatory to configure a particular logger.
The convention is use __CLASS__ as the logger name when
instanciating a new logger using LogManager->getLogger().

Resolves: #54909
Releases: 6.2, 6.1
Change-Id: I5dbda770ec92fd75c3aff9ed89c68c5666669b07
Reviewed-on: https://review.typo3.org/26755
Reviewed-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php

index 0206995..df65d16 100644 (file)
@@ -5148,7 +5148,7 @@ class ContentObjectRenderer {
                                        }
                                } catch(\TYPO3\CMS\Core\Resource\Exception $exception) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
                                        $logger->warning('The image "' . $file . '" could not be found and won\'t be included in frontend output');
                                        return NULL;
                                }
@@ -5416,7 +5416,7 @@ class ContentObjectRenderer {
                        }
                } catch (\TYPO3\CMS\Core\Resource\Exception $exception) {
                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
                        $logger->warning('The file "' . $fileUidOrCurrentKeyword . '" could not be found and won\'t be included in frontend output');
                        $fileObject = NULL;
                }
index 3dc7394..a24555f 100644 (file)
@@ -61,7 +61,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        $this->addToArray($fileRepository->findFileReferenceByUid($referenceUid), $fileObjects);
                                } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
                                        $logger->warning('The file-reference with uid  "' . $referenceUid . '" could not be found and won\'t be included in frontend output');
                                }
                        }
@@ -91,7 +91,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        $this->addToArray($fileRepository->findByUid($fileUid), $fileObjects);
                                } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
                                        $logger->warning('The file with uid  "' . $fileUid . '" could not be found and won\'t be included in frontend output');
                                }
                        }
@@ -109,7 +109,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        }
                                } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
                                        $logger->warning('The file-collection with uid  "' . $collectionUid . '" could not be found or contents could not be loaded and won\'t be included in frontend output');
                                }
                        }
@@ -127,7 +127,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                                }
                                        } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                                /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                               $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                               $logger = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
                                                $logger->warning('The folder with identifier  "' . $folderIdentifier . '" could not be found and won\'t be included in frontend output');
                                        }
                                }