[BUGFIX] Add missing logger names 54/26754/3
authorSteffen Müller <typo3@t3node.com>
Sat, 11 Jan 2014 11:14:41 +0000 (12:14 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 11 Jan 2014 13:01:25 +0000 (14:01 +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/26754
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php

index 3a5a90e..ba3b5a0 100644 (file)
@@ -5265,7 +5265,7 @@ class ContentObjectRenderer {
                                        }
                                } catch(\TYPO3\CMS\Core\Resource\Exception $exception) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = 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;
                                }
@@ -5543,7 +5543,7 @@ class ContentObjectRenderer {
                        }
                } catch (\TYPO3\CMS\Core\Resource\Exception $exception) {
                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                       $logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                       $logger = 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 5d0e482..6b74099 100644 (file)
@@ -78,7 +78,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        $this->addToArray($this->getFileRepository()->findFileReferenceByUid($referenceUid), $fileObjects);
                                } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = 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');
                                }
                        }
@@ -110,7 +110,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        $this->addToArray($this->getFileRepository()->findByUid($fileUid), $fileObjects);
                                } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = 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');
                                }
                        }
@@ -126,7 +126,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        }
                                } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                        /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                       $logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                       $logger = 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');
                                }
                        }
@@ -142,7 +142,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                                }
                                        } catch (\TYPO3\CMS\Core\Resource\Exception $e) {
                                                /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                                               $logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger();
+                                               $logger = 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');
                                        }
                                }