Skip to content

Instantly share code, notes, and snippets.

@stmllr
Last active September 20, 2016 13:04
Show Gist options
  • Save stmllr/180f4f367d2bf9e8f37c8752207da97d to your computer and use it in GitHub Desktop.
Save stmllr/180f4f367d2bf9e8f37c8752207da97d to your computer and use it in GitHub Desktop.
TYPO3 LogProcessor to add requestId to log records
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