Home  >  Article  >  Backend Development  >  How to select the system for php logs

How to select the system for php logs

墨辰丷
墨辰丷Original
2018-05-15 14:53:441803browse

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

How to install

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.ini configuration

  1. ##; configuration for php SeasLog module

  2. ##extension = seaslog .so
  3. seaslog.default_basepath = /log/seaslog-test ;Default log root directory
  4. seaslog.default_logger = default ;Default logger directory
  5. #seaslog.disting_type = 1 ; Whether to divide files by type 1 Yes 0 No (default)
  6. ##seaslog.disting_by_hour = 1 No ( Default)
  7. seaslog.use_buffer = 1 ; Whether to enable buffer 1 yes 0 no (default)
  8. seaslog.buffer_size = 100 ;;In buffer By default 0 (Buffer_size)
  9. # Seaslog.Level = 0; Record log level default 0 (all logs)
  10. # Seaslog. disting_type = 1 turns on dividing files by type, that is, log file distinction info\warn\erro

  11. seaslog.disting_by_hour = 1 turns on dividing a file every hour

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn