PHP (Professional Hypertext Preprocessor) based log collection and storage method and system
A caching system and log technology, applied in the network field, can solve problems such as the impact of database read and write capabilities, and achieve the effect of convenient collection and reduced writing pressure
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2015-11-04
- Estimated Expiration
- Not applicable · inactive patent
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
Description
technical field
[0001] The invention relates to the field of network technology, in particular to a method and system for collecting and storing logs based on PHP. Background technique
[0002] Now there are generally several ways to store log data, and the common one is to store it in local files or databases. For the storage scheme of the database, when the amount of log data is huge and the concurrency is high, it will have a huge impact on the read and write capabilities of the database. Contents of the invention
[0003] The technical problem to be solved by the present invention is to provide a method and system for collecting and storing logs based on PHP.
[0004] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: a method for collecting and storing logs based on PHP, comprising the following steps:
[0005] Step S1, the client reports log data;
[0006] Step S2, the log collection module collects the l...
Examples
Embodiment Construction
[0030] The principles and features of the present invention are described below in conjunction with the accompanying drawings, and the examples given are only used to explain the present invention, and are not intended to limit the scope of the present invention.
[0031] Explanation of terms involved in the present invention: PHP (foreign name: PHP: Hypertext Preprocessor, Chinese name: "hypertext preprocessor") is a general open source scripting language. Redis is an open-source, log-type, Key-Value database that is written in ANSIC language, supports network, can be memory-based or persistent, and provides APIs in multiple languages. MongoDB is a database based on distributed file storage, written in C++ language, designed to provide scalable high-performance data storage solutions for WEB applications.
[0032] figure 1 It is a flow chart of the method for collecting and storing logs based on PHP in the present invention.
[0033] like figure 1 As shown, a method for co...