Log Analysis-PHP program, if do program log?

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.