Last active
September 20, 2016 13:04
-
-
Save stmllr/180f4f367d2bf9e8f37c8752207da97d to your computer and use it in GitHub Desktop.
TYPO3 LogProcessor to add requestId to log records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Monolog\Processor; | |
use TYPO3\CMS\Core\Core\Bootstrap; | |
/** | |
* Adds TYPO3 requestId to records | |
*/ | |
class Typo3RequestIdProcessor | |
{ | |
/** | |
* @param array $record | |
* @return array | |
*/ | |
public function __invoke(array $record) | |
{ | |
$record['extra']['typo3_request_id'] = Bootstrap::getInstance()->getRequestId(); | |
return $record; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment