elementareteilchen / logmodifier
TYPO3 log processors for request URLs and compact exception output.
Package info
github.com/ElementareTeilchen/logmodifier
Type:typo3-cms-extension
pkg:composer/elementareteilchen/logmodifier
Requires
- php: ^8.2
- typo3/cms-core: ^12.4 || ^13.4 || ^14.0
README
This extension provides TYPO3 log processors that make production logs easier to read while preserving access to full exception context when needed.
Features
- Adds the current request URL to human-readable log messages.
- Compacts exception context into a short
file:linesuffix. - Keeps full exception context when the configured environment variable is enabled.
- Registers itself automatically through TYPO3 extension loading.
Installation
Install the extension with Composer:
composer require elementareteilchen/logmodifier
What Gets Registered
The extension registers two TYPO3 log processors for LogLevel::DEBUG in ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['LOG']['processorConfiguration'][LogLevel::DEBUG][RequestUrlProcessor::class] = []; $GLOBALS['TYPO3_CONF_VARS']['LOG']['processorConfiguration'][LogLevel::DEBUG][CompactExceptionProcessor::class] = [ 'fullLogEnvVar' => 'TYPO3_FULL_LOG', ];
TYPO3 applies processors registered on DEBUG to records at that level and above, so the processors run for the regular TYPO3 log levels.
Request URL Processor
RequestUrlProcessor appends the normalized request URL to the log message:
Something failed (URL: https://example.test/path?foo=bar)
It reads the PSR-7 request from $GLOBALS['TYPO3_REQUEST'] when available and falls back to $_SERVER.
Compact Exception Processor
CompactExceptionProcessor removes the full throwable from the log context and appends the exception source location to the message:
Something failed - in file /path/to/File.php:42
This keeps log output short and avoids dumping large stack traces into compact log targets.
Full Exception Logging
Set the environment variable configured by fullLogEnvVar to a truthy value to keep the original exception context:
TYPO3_FULL_LOG=true
By default, the extension uses TYPO3_FULL_LOG.
License
GPL-2.0-or-later