Is there any good log library for message, warning and errors flogging for PHP?AFAIK error_log
is only used for logging errors but i need to store also debug messages.
And should work with CLI. Thanks
The ini_set(“log_errors”, TRUE) command can be added to the php script to enable error logging in php. The ini_set('error_log', $log_file) command can be added to the php script to set the error logging file. Further error_log($error_message) function call can be used to log error message to the given file.
The PSR-3 (PHP Standards Recommendation) logging standard defines a logging interface with eight methods (debug, info, notice, warning, error, critical, alert, emergency). The message passed to those functions should be a string or an object with a __toString method to cast it into a string.
Enabling the PHP Error LogLog messages can be generated manually by calling error_log() or automatically when notices, warnings, or errors come up during execution. By default, the error log in PHP is disabled. You can enable the error log in one of two ways: by editing php. ini or by using ini_set .
Monolog, which powers Laravel's logging services, offers all of the log levels defined in the RFC 5424 specification. In descending order of severity, these log levels are: emergency, alert, critical, error, warning, notice, info, and debug.
error_log()
can write to arbitrary files...
error_log('Something blew up!', 3, '/some/path/debug.txt');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With