PHP development site, everyone on the system of the log is how to deal with it, I now use the Nginx server, which can be configured to log. In addition to this, in the program, with no need to do log-related architecture AH. Just like Java, there are tools available that open source like log4j. Does PHP need this?
Reply content:
PHP development site, everyone on the system of the log is how to deal with it, I now use the Nginx server, which can be configured to log. In addition to this, in the program, with no need to do log-related architecture AH. Just like Java, there are tools available that open source like log4j. Does PHP need this?
Nginx is the application server log, the most commonly used is the access log for the analysis request URI, request consumption time, client information and so on.
If there is a need to record in the business logic, it needs to be implemented in PHP. In PHP is free, generally directly to the text log file to write the string content is OK, the package of better can include these features: Log rating, by date file, write buffer, complex structure escaped and so on.
You can refer to the ZF log implementation, or you can look at this project: Https://github.com/katzgrau/KLogger
Simple business requirements can be implemented on their own, and some specifications can be referred to as psr-3.
I also use PHP to monitor the log analysis site IIS server, PHP read analysis 2 minutes ago Log, get useful information, 500 error 404 error, Access density ... Anyway to write their own use, troubleshooting problem tracking trend is very happy