Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
TASK: set request id from env if set in env, get rid of functions cal…
Browse files Browse the repository at this point in the history
…ling TYPO3 Bootstrap to get the request id

because the request id is not gettable anymore
  • Loading branch information
Christian Keuerleber committed Oct 22, 2020
1 parent b272e49 commit 0faee7d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 56 deletions.
11 changes: 0 additions & 11 deletions Classes/Div.php
Original file line number Diff line number Diff line change
Expand Up @@ -1614,15 +1614,4 @@ public static function isMinTypo3Version($minVersion)
$minVersionAsInt = VersionNumberUtility::convertVersionNumberToInteger($minVersion);
return $currentVersionAsInt >= $minVersionAsInt;
}


/**
* @return string
*/
public static function getCurrentRequestId()
{
###TODO
return '';
//return \TYPO3\CMS\Core\Core\Bootstrap:: getInstance()->getRequestId();
}
}
4 changes: 3 additions & 1 deletion Classes/Logger/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
***************************************************************/

use PunktDe\PtExtbase\Logger\Processor\ReplaceComponentProcessor;
use PunktDe\PtExtbase\Logger\Processor\SwitchRequestIdProcessor;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Log\LogLevel;
Expand Down Expand Up @@ -122,7 +123,8 @@ protected function configureLoggerProperties()
];

$GLOBALS['TYPO3_CONF_VARS']['LOG']['processorConfiguration'][LogLevel::DEBUG] = [
ReplaceComponentProcessor::class => []
ReplaceComponentProcessor::class => [],
SwitchRequestIdProcessor::class => []
];
}

Expand Down
29 changes: 29 additions & 0 deletions Classes/Logger/Processor/SwitchRequestIdProcessor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace PunktDe\PtExtbase\Logger\Processor;

/*
* (c) 2020 punkt.de GmbH - Karlsruhe, Germany - https://punkt.de
* All rights reserved.
*/

use \TYPO3\CMS\Core\Log\LogRecord;
use \TYPO3\CMS\Core\Log\Processor\AbstractProcessor;

class SwitchRequestIdProcessor extends AbstractProcessor
{
/**
* @param LogRecord $logRecord
* @return LogRecord
*/
public function processLogRecord(LogRecord $logRecord)
{
$requestId = getenv('REQUEST_ID');

if ($requestId !== false) {
$logRecord->setRequestId($requestId);
}

return $logRecord;
}
}
44 changes: 0 additions & 44 deletions Classes/Utility/RequestInformation.php

This file was deleted.

0 comments on commit 0faee7d

Please sign in to comment.