Class Log
A simple static class for logging messages in MODX. Wraps around modx()->log() and supports different log levels.
Log levels
| Constant | Value | Description |
|---|---|---|
LEVEL_FATAL | 0 | Critical error |
LEVEL_ERROR | 1 | Standard error |
LEVEL_WARN | 2 | Warning message |
LEVEL_INFO | 3 | Informational message |
LEVEL_DEBUG | 4 | Debugging information |
Methods
php
Log::fatal('Fatal error occurred');
Log::error('Request failed');
Log::warn('Configuration warning');
Log::info('Task completed successfully');
Log::debug('Debug details');Helper logger
php
logger('Something went wrong'); // Same as Log::error(...)