Home > Article > Backend Development > How to select the system for php logs
This article mainly introduces how to select the PHP log system. Interested friends can refer to it. I hope it will be helpful to everyone.
What is currently provided
●Convenient and standardized log recording in PHP projects
●Configurable default log directory and module
●Specify the log directory and obtain the current configuration
●Preliminary analysis and warning framework
●Efficient log buffering and convenient buffer debugging
●Follow PSR- 3 Log interface specification
After obtaining the source code, you can compile it yourself.
$ /path/to/phpize
$ ./configure --with-php-config=/path/to/php-config
$ make && make install
Of course, it will be more convenient to use PECL management tools:
$ pecl install seaslog
# Seaslog. disting_type = 1 turns on dividing files by type, that is, log file distinction info\warn\erro
seaslog.use_buffer = 1 turns on buffer. Off by default. When this option is turned on, the log is pre-stored in memory and written to the file once when the request ends (or exits abnormally).
seaslog.buffer_size = 100 Set the buffer quantity to 100. The default is 0, that is, there is no buffer quantity limit. When buffer_size is greater than 0, the file will be written once when the buffer quantity reaches this value.
seaslog .level = 3 The log level recorded. The default is 0, that is, all logs are recorded. When level is 1, focus on levels above debug (including debug), and so on. When level is greater than 8, all logs will not be recorded.
Related recommendations:
High performance php log system analysis
php logs and other big data are stored in the database. Compressed data format
High-performance php log solution idea
The above is the detailed content of How to select the system for php logs. For more information, please follow other related articles on the PHP Chinese website!