Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP good log library?

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

like image 353
gremo Avatar asked Nov 25 '11 14:11

gremo


People also ask

How to make Logger in PHP?

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.

What is a PSR log?

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.

How do I log information in PHP?

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 .

What is monolog laravel?

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.


1 Answers

error_log() can write to arbitrary files...

error_log('Something blew up!', 3, '/some/path/debug.txt');
like image 145
Marc B Avatar answered Sep 28 '22 05:09

Marc B