2 declare(strict_types = 1);
19 use Psr\Http\Message\ServerRequestInterface;
47 $this->configurationService = GeneralUtility::makeInstance(ConfigurationService::class);
66 'LLL:EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf:submodule.log.label'
73 public function getDataToStore(ServerRequestInterface $request): ModuleData
87 foreach ($log as $logRecord) {
88 $entry = $logRecord->toArray();
90 unset($entry[
'data']);
93 return new ModuleData(
107 $view = GeneralUtility::makeInstance(StandaloneView::class);
108 $templateNameAndPath =
'EXT:adminpanel/Resources/Private/Templates/Modules/Debug/LogSettings.html';
109 $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
110 $view->setPartialRootPaths([
'EXT:adminpanel/Resources/Private/Partials']);
119 $view->assignMultiple(
128 return $view->render();
137 public function getContent(ModuleData $data): string
140 $view = GeneralUtility::makeInstance(StandaloneView::class);
141 $templateNameAndPath =
'EXT:adminpanel/Resources/Private/Templates/Modules/Debug/Log.html';
142 $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
143 $view->setPartialRootPaths([
'EXT:adminpanel/Resources/Private/Partials']);
149 foreach ($data[
'log'] as $logRecord) {
150 if ($logRecord[
'level'] > $this->logLevel) {
153 if ($groupByComponent && $groupByLevel) {
154 $sortedLog[$logRecord[
'component']][
LogLevel::getName($logRecord[
'level'])][] = $logRecord;
155 } elseif ($groupByComponent) {
156 $sortedLog[$logRecord[
'component']][] = $logRecord;
157 } elseif ($groupByLevel) {
158 $sortedLog[$logRecord[
'level']][] = $logRecord;
160 $sortedLog[] = $logRecord;
163 $data[
'log'] = $sortedLog;
164 $data[
'groupByComponent'] = $groupByComponent;
165 $data[
'groupByLevel'] = $groupByLevel;
166 $view->assignMultiple($data->getArrayCopy());
168 return $view->render();
182 $GLOBALS[
'TYPO3_CONF_VARS'][
'LOG'] = array_filter(
183 $configWithInMemoryWriter
189 foreach ($logConfig as $key => $value) {
190 if ($key ===
'writerConfiguration') {
191 $logConfig[$key] = $value;
193 } elseif (is_array($value)) {
206 return $this->configurationService->getConfigurationOption(
'debug_log', $option);