Logger
MaplePHP PSR-3 Logger library – your reliable companion for efficient logging in PHP applications. This library adheres to the PSR-3 standard, providing a seamless and standardized approach to logging
Log-levels
emergency: System is unusable
alert: Action must be taken immediately
critical: Critical conditions
error: Runtime errors that do not require immediate action but usually logged and monitored.
warning: Exceptional occurrences that are not errors.
notice: Normal but significant events.
info: Interesting events (User logs in, SQL logs.)
debug: Detailed debug information.
log: Logs with an arbitrary level.
Logger in provider
You can access the logger with the help of the Service Provider, e.g it is utilizing the StreamHandler.
Stream/file handler
Or you could access it directly through the Logger library and build your own logger service.
Add namespaces
Create simple stream logger
Rotatable log files
Create simple stream rotatables loggers. Will create a new log file if size is more than MAX_SIZE (5000 KB) and remove log files if total file count is more than MAX_COUNT 10.
Database handler
Add namespaces
1. Connect to the database.
Install the database with the MakePHP cli.
2. Create database table
Install the database table with the MakePHP cli.
3. Write to database log
PHP error log handler (error_log())
You can (not required) specify a log file location in ErrorLogHandler. If argument is empty, then server default location.
Add namespaces
Last updated