Home >Backend Development >PHP Tutorial >High performance php log system analysis
What is a logging system? ?
1. Record system running information
2. Record logs, applications, and security logs
3. The log function should not affect the normal use of users
Why do we need a logging system? ?
1. Understand the system operation
2. Record user operation information
3. Collect data (such as 500 error, how many times it occurs)
Why choose seaslog? ?
1. High performance (written in C language)
2. No configuration required (write to flash memory first, then write to file after reaching a certain amount)
3. Complete functions Simple to use
1. Record when someone comes.
2, Record what the user sees I didn’t see it. After seeing it, record what I saw
....
Note: It is an extension of php, not an ordinary class library
##http://pecl.php.net/ InstallphpExtension and come to this website to find the package
##1. Unzip and switch to
2.
Enterphpize3, ./configure --with-php-config=
/www/server/php/54/bin/php-config(where your php-config is located Absolute path)4. make && make install
5.
Modifyphp.ini, add the last line extension=seaslog.so
in the browser. It means the installation is successful, but when executing php -m on Linux, it does not work. I don’t know why yet. I hope you know. Leave me a message to add
##seaslog
##https://github.com/SeasX/SeasLog/blob/master/ README_zh.md
# #These methods are static methods and can be called directly. When testing, use the browser to access, or php -fsetBasePath
: Set the path to save the logSetLogger:
Save different modules to Under different pathsanalyzerCount
:
Log statistics
Use seaslog in the framework
2. Load the class library from github into the framework using composer or other methods
Then it will be the same as using a normal class library
Idea 1, directly call
Idea 2 in the controller, change the configuration file of log
Then encapsulate it yourself (same as idea 1, also call it directly in the method of the controller or model)
Related recommendations:
Detailed introduction to the log system
The above is the detailed content of High performance php log system analysis. For more information, please follow other related articles on the PHP Chinese website!