Log collecting and printing method and system, log platform and back-end server

By using request unique identification and call order identification for log grouping between the log platform and the backend server, the problem of confusing log collection printing order and indistinguishable from the same request log logs is solved, and the efficiency and user experience of log query are improved.

CN118916339AActive Publication Date: 2024-11-08INNER MONGOLIA YILI IND GROUP CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310500702.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2024-11-08
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

When there are too many service requests, the log collection and printing order is chaotic and difficult to find. The same request generates the same log, which cannot distinguish the call link, resulting in low efficiency in troubleshooting problems.

Method used

By introducing request unique identifiers between the log platform and the backend server, generating log collection requests, and grouping logs based on request unique identifiers and call order identification, ensuring that logs are stored and queried in request and call order.

Benefits of technology

It improves the efficiency and convenience of log collection and printing, clarifies the log call link, simplifies the fault location process, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916339A_ABST
    Figure CN118916339A_ABST
Patent Text Reader

Abstract

The invention discloses a log collecting and printing method and system, a log platform and a back-end server, and the method comprises the steps that when the log platform receives a printing application of a user for a log corresponding to a historical access request, a collection request is sent to the back-end server according to a unique identifier of the historical access request; the unique identifier of the request is an identifier generated when a user initiates an access request for a preset function of a front-end page; the back-end server collects logs generated by all calling methods or applications corresponding to each request to a log platform according to the unique identifier of the request; each log comprises a unique identifier of the request and a calling sequence identifier generated according to the calling sequence; and the log platform groups the collected logs according to the unique identifier of the request and the identifier of the calling sequence to obtain the log corresponding to each request and the calling sequence for a user to query and print. According to the invention, the efficiency and convenience of log collection and printing can be improved, and thus the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a log collection and printing method, system, log platform and back-end server. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] With the rapid iteration of business functions, the subsequent operation and maintenance work of each business system is increasing. Each business system is developed by different personnel with different coding styles. It is very time-consuming and slow to troubleshoot online problems. Therefore, the subsequent operation and maintenance work is extremely challenging.

[0004] Log tools are an important means of locating online problems and troubleshooting. Logs are needed for both small and large complex systems. They are the basis for ensuring high availability of the system. They record error information, status information, debugging information, time consumption, and other information generated when the program is running. In a production environment, logs are an important basis for us to find problems.

[0005] Currently, the log capabilities of business systems are built independently, the log sources are relatively scattered, and the speed of log generation is getting faster and faster. Traditional tools (such as log4j, jul and other tools) can no longer meet people's needs.

[0006] The most commonly used tool on the market is log4j, which is an open source project of Apache and an excellent logging tool. Many log platforms are also encapsulated based on log4j underlying technology. During use, you can define parameters such as log output level, format, and destination. It is convenient to use and is therefore favored by most developers. However, when using it, if too many logs are printed for the same application, the log files are easily mixed together, which is very inconvenient for developers to view and makes it difficult to troubleshoot problems. Figure 1 As shown:

[0007] 1. The user visits three page functions, Function I, Function II, and Function III, on the product page. Among them:

[0008] Function I: Call backend method A, method 1, and database 1 application respectively to generate log files ①④⑧;

[0009] Function II: call backend method B, method 2, method C, method 3, and third-party applications respectively to generate log files ②⑤⑥⑦⑨;

[0010] Function III: Call backend method C, method 3, and third-party application respectively to generate log files ③⑦⑨.

[0011] 2. When viewing the log center in the backend, users expect to see that the log collection and printing order is printed according to the functional dimension, that is, ①④⑧②⑤⑥⑦⑨③⑦⑨; however, the actual log collection and printing order is based on the chronological order: ①②③④⑤⑥⑦⑦⑧⑨⑨; due to the disordered printing order, it brings great trouble to users and the efficiency of troubleshooting is low.

[0012] Therefore, the disadvantage of the prior art log4j log tool is that the order of log collection and printing is collected according to the order of implementation, such as Figure 1 The horizontal order, i.e. ①-⑨, is printed in sequence; therefore, the order of the user's request sequence system methods and the order of log collection are inconsistent. When the user requests a large amount of data, it is difficult to troubleshoot the problem. At the same time, when the user operates function II and function III, the process of method C to the third-party application is used twice, thus generating two identical logs ⑦⑦⑨⑨. When the user views the log platform, it is unclear which request generated the log record, which increases the difficulty of troubleshooting. Summary of the invention

[0013] An embodiment of the present invention provides a log collection and printing method, which is applied to a system to solve the problem that the order of log collection and printing is chaotic and difficult to find when there are too many service requests, and the problem that the same logs generated by the same request on the log platform cannot distinguish the call links of the logs. The method includes:

[0014] When the log platform receives a print request from a user for a log corresponding to a historical access request, it generates a log collection request based on the unique identifier of the historical access request and sends the log collection request to the back-end server; the unique identifier of the request is the identifier generated when the user initiates an access request to a preset function of the front-end page;

[0015] The backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request; each collected log is a log generated by the backend server based on the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the unique identifier of the request and the call sequence identifier generated according to the call sequence;

[0016] The log platform groups the collected logs according to the unique request identifier and the call sequence identifier, and obtains the logs corresponding to each request and call sequence for users to query and print.

[0017] An embodiment of the present invention provides a log collection and printing method, which is applied to a log platform to solve the problem that the log collection and printing order is chaotic and difficult to find when there are too many service requests, and the problem that the same logs generated by the same request on the log platform cannot distinguish the call links of the logs. The method includes:

[0018] Receive a user's request to print a log corresponding to a historical access request;

[0019] Generate a log collection request based on the unique identifier of the historical access request; the unique identifier of the request is an identifier generated when the user initiates an access request to a preset function of the front-end page;

[0020] Send a log collection request to the backend server; the log collection request includes a unique identifier of the request, and the unique identifier of the request is used by the backend server to collect the logs generated by all calling methods or applications corresponding to each request to the log platform; each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or application to process historical access requests, and each log contains the unique identifier of the request and the call sequence identifier generated according to the call sequence;

[0021] The collected logs are grouped according to the request unique identifier and the call sequence identifier, and the logs corresponding to each request and call sequence are obtained for users to query and print.

[0022] An embodiment of the present invention provides a log collection and printing method, which is applied to a backend server to solve the problem that the order of log collection and printing is chaotic and difficult to find when there are too many service requests, and the problem that the same logs generated by the same request on the log platform cannot distinguish the call links of the logs. The method includes:

[0023] Receive a log collection request; the log collection request is a request generated by the log platform when receiving a user's application for printing a log corresponding to a historical access request, and the log collection request includes a unique identifier of the request, which is an identifier generated when the user initiates an access request to a preset function of a front-end page;

[0024] According to the unique identifier of the request, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the request unique identifier and the call sequence identifier generated according to the call sequence. The request unique identifier and the call sequence identifier are used for the log platform to group the collected logs for users to query and print.

[0025] The embodiment of the present invention further provides a log collection and printing system, which is used to solve the problem that the order of log collection and printing is chaotic and difficult to find when there are too many service requests, and the problem that the same logs generated by the same request on the log platform cannot distinguish the call links of the logs. The system includes:

[0026] The log platform is used to generate a log collection request according to the unique identifier of the historical access request when receiving a user's application for printing the log corresponding to the historical access request, and send the log collection request to the back-end server; the unique identifier of the request is an identifier generated when the user initiates an access request for the preset function of the front-end page; the collected logs are grouped according to the request unique identifier and the call sequence identifier, and the logs corresponding to each request and call sequence are obtained for the user to query and print;

[0027] The back-end server is used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the unique identifier of the request and the call sequence identifier generated according to the call sequence.

[0028] The embodiment of the present invention further provides a log collection and printing platform, which is used to solve the problem that the order of log collection and printing is chaotic and difficult to find when there are too many service requests, and the problem that the same logs generated by the same request on the log platform cannot distinguish the call links of the logs. The log platform includes:

[0029] A first receiving unit, configured to receive a user's application for printing a log corresponding to a historical access request;

[0030] A generating unit, configured to generate a log collection request according to a unique identifier of a historical access request; the unique identifier of the request is an identifier generated when a user initiates an access request to a preset function of a front-end page;

[0031] A sending unit is used to send a log collection request to a backend server; the log collection request includes a unique identifier of the request, and the unique identifier of the request is used for the backend server to collect logs generated by all calling methods or applications corresponding to each request to a log platform; each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or application to process a historical access request, and each log includes a unique identifier of the request and a call sequence identifier generated according to the call sequence;

[0032] The printing processing unit is used to group the collected logs according to the request unique identifier and the calling sequence identifier, and obtain the log corresponding to each request and calling sequence for user query and printing.

[0033] The embodiment of the present invention further provides a log collection and printing backend server, which is used to solve the problem that the order of log collection and printing is chaotic and difficult to find when there are too many service requests, and the problem that the same logs generated by the same request on the log platform cannot distinguish the call links of the logs. The backend server includes:

[0034] A second receiving unit is used to receive a log collection request; the log collection request is a request generated by the log platform when receiving a print application from a user for a log corresponding to a historical access request, and the log collection request includes a unique identifier of the request, which is an identifier generated when the user initiates an access request to a preset function of a front-end page;

[0035] The collection and processing unit is used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the request unique identifier and the call sequence identifier generated according to the call sequence; the request unique identifier and the call sequence identifier are used for the log platform to group the collected logs for user query and printing.

[0036] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the log collection and printing method when executing the computer program.

[0037] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned log collection and printing method is implemented.

[0038] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned log collection and printing method is implemented.

[0039] In an embodiment of the present invention, a log collection and printing scheme works as follows: when a log platform receives a print application from a user for a log corresponding to a historical access request, it generates a log collection request based on a unique identifier of the historical access request, and sends the log collection request to a back-end server; the unique identifier of the request is an identifier generated when a user initiates an access request to a preset function of a front-end page; the back-end server collects logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request; each collected log is a log generated by the back-end server based on the unique identifier of the request when each calling method or application is called to process the historical access request, and each log contains a request unique identifier and a call sequence identifier generated based on the call sequence; the log platform groups the collected logs based on the request unique identifier and the call sequence identifier, and obtains logs corresponding to each request and call sequence for user query and printing.

[0040] The beneficial technical effects of the log collection and printing solution provided by the embodiment of the present invention are:

[0041] First, the embodiment of the present invention adds a unique identifier for the request, and the subsequent log collection process will carry the unique identifier, which solves the problem that the original conventional method collects and prints logs in chronological order, resulting in inconsistency between the user request order and the log collection order.

[0042] Secondly, the embodiment of the present invention generates a call sequence identifier for the log according to the call sequence, which solves the problem that the same request generates the same log, and the user cannot distinguish which request generated the log record when viewing the log platform, and cannot locate the fault.

[0043] In summary, the log collection and printing solution provided by the embodiment of the present invention can improve the efficiency and convenience of log collection and printing, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0045] Figure 1 This is a schematic diagram of the principle of log collection and printing in the prior art;

[0046] Figure 2 This is a schematic diagram of the principle of log collection and printing in an embodiment of the present invention;

[0047] Figure 3A flow chart of a log collection and printing method applied to a system in an embodiment of the present invention;

[0048] Figure 4 It is a flow chart of a log collection and printing method applied to a log platform in an embodiment of the present invention;

[0049] Figure 5 It is a flow chart of a log collection and printing method applied to a back-end server in an embodiment of the present invention;

[0050] Figure 6 A schematic diagram of the structure of a log collection and printing system according to an embodiment of the present invention;

[0051] Figure 7 This is a schematic diagram of the structure of a log collection and printing log platform in an embodiment of the present invention;

[0052] Figure 8 This is a schematic diagram of the structure of the log collection and printing backend server in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0054] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of laws and regulations.

[0055] Figure 3 FIG. 1 is a flow chart of a log collection and printing method applied to a system in an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0056] Step 101: When receiving a print request from a user for a log corresponding to a historical access request, the log platform generates a log collection request according to a unique identifier of the historical access request, and sends the log collection request to a backend server; the unique identifier of the request is an identifier generated when the user initiates an access request to a preset function of the front-end page;

[0057] Step 102: The backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request; each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or application to process the historical access request, and each log contains the unique identifier of the request and the calling sequence identifier generated according to the calling sequence;

[0058] Step 103: The log platform groups the collected logs according to the request unique identifier and the call sequence identifier, and obtains the log corresponding to each request and call sequence for the user to query and print.

[0059] The log collection and printing method provided by the embodiment of the present invention is as follows: when the log platform receives a user's application for printing a log corresponding to a historical access request, it generates a log collection request based on the unique identifier of the historical access request and sends the log collection request to the back-end server; the unique identifier of the request is an identifier generated when the user initiates an access request to a preset function of the front-end page; the back-end server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request; each collected log is a log generated by the back-end server based on the unique identifier of the request when calling each calling method or application to process the historical access request, and each log contains the request unique identifier and a call sequence identifier generated based on the call sequence; the log platform groups the collected logs based on the request unique identifier and the call sequence identifier, and obtains the logs corresponding to each request and the call sequence for the user to query and print.

[0060] The beneficial technical effects of the log collection and printing method provided by the embodiment of the present invention are:

[0061] First, the embodiment of the present invention adds a unique identifier for the request, and the subsequent log collection process will carry the unique identifier, which solves the problem that the original conventional method collects and prints logs in chronological order, resulting in inconsistency between the user request order and the log collection order.

[0062] Secondly, the embodiment of the present invention generates a call sequence identifier for the log according to the call sequence, which solves the problem that the same request generates the same log, and the user cannot distinguish which request generated the log record when viewing the log platform, and cannot locate the fault.

[0063] In summary, the log collection and printing method provided by the embodiment of the present invention can improve the efficiency and convenience of log collection and printing, thereby improving the user experience.

[0064] Based on the problems in the current service call process, the embodiment of the present invention proposes a log collection and printing tool design solution, which solves the problem that the log collection and printing order is chaotic and difficult to find when there are too many service requests; at the same time, it also solves the problem that the same request generates the same log on the log platform, and the call link of the log cannot be distinguished. Figure 2 The technical solutions in the embodiments of the present invention are described clearly and completely.

[0065] 1. As Figure 2 As shown, add a log request ID generator, every time a user accesses a specific function (such as Figure 2 Function I, Function II, Function III), when the front-end service calls the interface of the back-end server, the log request ID generator first generates a unique identification ID for the current request. That is, in one embodiment, Figure 2 As shown, the unique identifier of the request is generated by a log request ID generator.

[0066] 2. Specify the starting position of log collection: You can use the AOP principle in Java to specify the starting position of log collection by scanning the directory. As long as you request the service under the directory, the log platform will record the starting position of the request and generate a log, such as: I-1, II-1, III-1.

[0067] 3. Specify the collection scope: You can also use the AOP principle in Java to specify the log collection scope by scanning the directory. The logs of the basic components that are not in this directory will not be recorded. Therefore, only valid log data is generated, such as I-2, I-3 or II-2, II-3...etc.

[0068] As can be seen from the above, in one embodiment, each collected log is a log generated by the backend server when calling each calling method or applying a historical access request, according to the unique identifier of the request, the specified log collection starting position and the specified collection range; each log also includes the specified log collection starting position and the specified collection range;

[0069] The back-end server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request, which may include: the back-end server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request, the specified log collection starting position and the specified collection range.

[0070] During the specific implementation, the inventor discovered a technical problem: during the startup of each application system, it will rely on many basic components that are not related to the business system, and the actual business logic function accounts for less than 1% (estimated value, the actual value may be less), so when extracting logs from the log platform according to the unique request identifier, the effective data accounts for less than 1%, and a large amount of garbage data will be generated; developers need to filter the log content one by one to locate the problem, and troubleshooting is still slow. It is precisely because the inventor discovered the above technical problems that he proposed the plan of considering the log collection starting position and the log generated by the specified collection range in steps 2 and 3 above, and collecting and printing logs, which further improved the efficiency of log collection and printing.

[0071] 4. Figure 2The backend service (backend server) shown in the figure, after obtaining the current request number (identifier) ​​in the previous step, the subsequent log collection process will carry the code, and will generate an increasing and regular number according to the order of the calls, such as I-1, I-2, I-3, etc. That is, in one embodiment, the call sequence identifier can be a code that increases according to the call time sequence.

[0072] 5. In the process of log collection, the collection method can be based on the request time dimension (horizontally) or based on the request sequence dimension (vertically). Usually, the collection method is based on the request sequence. That is, in one embodiment, the backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request, including: the backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request and based on the request time dimension or the request sequence dimension.

[0073] 6. After the logs are collected to the log platform, the log platform will analyze and process the logs according to the request code and call sequence code, and group them according to the request code; the grouped logs are as follows:

[0074] Request 1 log: I-1, I-2, I-3;

[0075] Request 2 log: II-1, II-2, II-3, II-4, II-5;

[0076] Request 3 log: II-1, II-2, II-3.

[0077] 7. The user can view the log file through the log platform to quickly locate the problem. That is, in one embodiment, the log corresponding to each request and calling sequence is printed to locate the problem or fault of the calling method or application.

[0078] In summary, the log collection and printing method provided by the embodiment of the present invention realizes:

[0079] 1. The embodiment of the present invention adds a log file request ID generator to ensure that each front-end page request code (identifier) ​​is unique; the generated request ID is passed to all subsequent calling methods or applications to ensure that all calling methods carry the identifier for each request.

[0080] 2. The embodiment of the present invention adds a log collection starting position to more conveniently determine the log printing code.

[0081] 3. The embodiment of the present invention increases the scope of log collection, reduces the log collection work of the dependent basic components, increases the accuracy of log collection, and is highly efficient.

[0082] 4. In the method calling process, the embodiment of the present invention generates an incremental code each time. Combined with the request ID of the log, it can ensure the uniqueness of the log and the sequence of log requests.

[0083] 5. In the process of log collection, the embodiment of the present invention uses the AOP principle in Java to realize automatic printing of logs through directory scanning, avoiding the complex logic of manual call for each print.

[0084] 6. Analyze and process the logs on the log platform and group them according to the request dimension, so that logs with the same request dimension can be displayed together.

[0085] In addition, the unique identifier generated by the log generator in the embodiment of the present invention is unique each time; the log collection work is implemented based on the AOP principle of the Java basic language, ensuring that the input and output parameters of all methods can be intercepted through package scanning each time a method is called, and the log can be written to the log platform.

[0086] The log collection and printing method provided by the embodiment of the present invention has the following beneficial effects:

[0087] 1. Add a unique identifier for the request, analyze and process the logs, and solve the problem that the original conventional method of collecting and printing logs is based on chronological order, resulting in inconsistency between the order of user request system methods and the order of log collection.

[0088] 2. Re-encode the serial number of the log request to solve the problem of two identical logs generated by two identical requests. When users view the log platform, they cannot tell which request generated the log record and cannot locate the problem.

[0089] 3. The log files after analysis and processing are clearer and more orderly, which greatly improves the efficiency of troubleshooting.

[0090] The embodiment of the present invention also provides a log collection and printing method applied to a log platform, as described in the following embodiment. Since the principle of solving the problem by the log collection and printing method applied to the log platform is similar to that of the log collection and printing method applied to the system, the implementation of the log collection and printing method applied to the log platform can refer to the implementation of the log collection and printing method applied to the system, and the repeated parts will not be repeated.

[0091] Figure 4 FIG. 1 is a flow chart of a log collection and printing method applied to a log platform in an embodiment of the present invention. Figure 4 As shown, the method comprises the following steps:

[0092] Step 201: receiving a user's request to print a log corresponding to a historical access request;

[0093] Step 202: Generate a log collection request according to the unique identifier of the historical access request; the unique identifier of the request is an identifier generated when the user initiates an access request to the preset function of the front-end page;

[0094] Step 203: Send the log collection request to the backend server; the log collection request includes a unique identifier of the request, and the unique identifier of the request is used for the backend server to collect the logs generated by all calling methods or applications corresponding to each request to the log platform; each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or application to process the historical access request, and each log includes the unique identifier of the request and the calling sequence identifier generated according to the calling sequence;

[0095] Step 204: Group the collected logs according to the request unique identifier and the calling sequence identifier, and obtain the logs corresponding to each request and calling sequence for the user to query and print.

[0096] The embodiment of the present invention also provides a log collection and printing method applied to a back-end server, as described in the following embodiment. Since the principle of solving the problem by the log collection and printing method applied to the back-end server is similar to that of the log collection and printing method applied to the system, the implementation of the log collection and printing method applied to the back-end server can refer to the implementation of the log collection and printing method applied to the system, and the repeated parts will not be repeated.

[0097] Figure 5 FIG. 1 is a flow chart of a log collection and printing method applied to a backend server in an embodiment of the present invention. Figure 5 As shown, the method comprises the following steps:

[0098] Step 301: receiving a log collection request; the log collection request is a request generated by the log platform when receiving a print request from a user for a log corresponding to a historical access request, and the log collection request includes a unique identifier of the request, which is an identifier generated when the user initiates an access request to a preset function of a front-end page;

[0099] Step 302: Based on the unique identifier of the request, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform; each collected log is a log generated by the back-end server based on the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the request unique identifier and the call sequence identifier generated according to the call sequence. The request unique identifier and the call sequence identifier are used by the log platform to group the collected logs for user query and printing.

[0100] In one embodiment, each collected log is a log generated by the backend server when calling each calling method or applying a historical access request according to the unique identifier of the request, the specified log collection starting position and the specified collection range; each log also includes the specified log collection starting position and the specified collection range;

[0101] According to the unique identifier of the request, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform, including: according to the unique identifier of the request, the specified log collection starting position and the specified collection range, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform.

[0102] The present invention also provides a log collection and printing system, as described in the following embodiments. Since the principle of solving the problem by the system is similar to that of the log collection and printing method applied to the system, the implementation of the system can refer to the implementation of the log collection and printing method applied to the system, and the repeated parts will not be repeated.

[0103] Figure 6 FIG. 1 is a schematic diagram of the structure of a log collection and printing system in an embodiment of the present invention. Figure 6 As shown, the system includes:

[0104] The log platform 01 is used to generate a log collection request according to the unique identifier of the historical access request when receiving a print request for the log corresponding to the historical access request from the user, and send the log collection request to the back-end server; the unique identifier of the request is an identifier generated when the user initiates an access request for the preset function of the front-end page; the collected logs are grouped according to the request unique identifier and the call sequence identifier, and the logs corresponding to each request and the call sequence are obtained for the user to query and print;

[0105] The back-end server 02 is used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process historical access requests, and each log contains the unique identifier of the request and the call sequence identifier generated according to the call sequence.

[0106] The embodiment of the present invention also provides a log collection and printing log platform, as described in the following embodiment. Since the principle of solving the problem by the log platform is similar to the log collection and printing method applied to the system, the implementation of the log platform can refer to the implementation of the log collection and printing method applied to the system, and the repeated parts will not be repeated.

[0107] Figure 7 FIG. 1 is a schematic diagram of the structure of a log collection and printing log platform in an embodiment of the present invention. Figure 7As shown, the log platform includes:

[0108] The first receiving unit 011 is used to receive a user's application for printing a log corresponding to a historical access request;

[0109] A generating unit 012 is used to generate a log collection request according to a unique identifier of a historical access request; the unique identifier of the request is an identifier generated when a user initiates an access request to a preset function of a front-end page;

[0110] The sending unit 013 is used to send the log collection request to the back-end server; the log collection request includes a unique identifier of the request, and the unique identifier of the request is used for the back-end server to collect the logs generated by all calling methods or applications corresponding to each request to the log platform; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process the historical access request, and each log includes the unique identifier of the request and the calling sequence identifier generated according to the calling sequence;

[0111] The printing processing unit 014 is used to group the collected logs according to the request unique identifier and the calling sequence identifier, and obtain the log corresponding to each request and calling sequence for the user to query and print.

[0112] The embodiment of the present invention also provides a log collection and printing backend server, as described in the following embodiment. Since the principle of solving the problem by the backend server is similar to the log collection and printing method applied to the system, the implementation of the backend server can refer to the implementation of the log collection and printing method applied to the system, and the repeated parts will not be repeated.

[0113] Figure 8 FIG. 1 is a schematic diagram of the structure of the log collection and printing backend server in an embodiment of the present invention. Figure 8 As shown, the backend server includes:

[0114] The second receiving unit 021 is used to receive a log collection request; the log collection request is a request generated by the log platform when receiving a print application from a user for a log corresponding to a historical access request, and the log collection request includes a unique identifier of the request, which is an identifier generated when the user initiates an access request to a preset function of a front-end page;

[0115] The collection and processing unit 022 is used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process historical access requests, and each log contains the request unique identifier and the call sequence identifier generated according to the call sequence; the request unique identifier and the call sequence identifier are used for the log platform to group the collected logs for user query and printing.

[0116] In one embodiment, each collected log is a log generated by the backend server when calling each calling method or applying a historical access request according to the unique identifier of the request, the specified log collection starting position and the specified collection range; each log also includes the specified log collection starting position and the specified collection range;

[0117] The collection and processing unit is specifically used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request, the specified log collection starting position and the specified collection range.

[0118] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the log collection and printing method when executing the computer program.

[0119] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned log collection and printing method is implemented.

[0120] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned log collection and printing method is implemented.

[0121] The beneficial technical effects of the log collection and printing solution provided by the embodiment of the present invention are:

[0122] First, the embodiment of the present invention adds a unique identifier for the request, and the subsequent log collection process will carry the unique identifier, which solves the problem that the original conventional method collects and prints logs in chronological order, resulting in inconsistency between the user request order and the log collection order.

[0123] Secondly, the embodiment of the present invention generates a call sequence identifier for the log according to the call sequence, which solves the problem that the same request generates the same log, and the user cannot distinguish which request generated the log record when viewing the log platform, and cannot locate the fault.

[0124] In summary, the log collection and printing solution provided by the embodiment of the present invention can improve the efficiency and convenience of log collection and printing, thereby improving the user experience.

[0125] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0127] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0129] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A log collection and printing method, characterized in that: The method is applied to a system, the method comprising: When the log platform receives a print request from a user for a log corresponding to a historical access request, it generates a log collection request based on the unique identifier of the historical access request and sends the log collection request to the back-end server; the unique identifier of the request is the identifier generated when the user initiates an access request to a preset function of the front-end page; The backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request; each collected log is a log generated by the backend server based on the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the unique identifier of the request and the call sequence identifier generated according to the call sequence; The log platform groups the collected logs according to the unique request identifier and the call sequence identifier, and obtains the logs corresponding to each request and call sequence for users to query and print.

2. The method according to claim 1, characterized in that Each collected log is a log generated by the backend server when calling each calling method or applying to process historical access requests, based on the unique identifier of the request, the specified log collection starting position and the specified collection range; each log also includes the specified log collection starting position and the specified collection range; The backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request, including: the backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request, the specified log collection starting position and the specified collection range.

3. The method according to claim 1, characterized in that The calling sequence identifier is a code that increases in sequence according to the calling time.

4. The method according to claim 1, characterized in that The backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request, including: the backend server collects the logs generated by all calling methods or applications corresponding to each request to the log platform based on the unique identifier of the request and the request time dimension or the request sequence dimension.

5. The method according to claim 1, characterized in that The logs printed for each request and calling sequence are used to locate problems or faults in calling methods or applications.

6. The method according to claim 1, characterized in that The unique identifier of the request is generated by a log ID generator.

7. A log collection and printing method, characterized in that: The method is applied to a log platform, and the method includes: Receive a user's request to print a log corresponding to a historical access request; Generate a log collection request based on the unique identifier of the historical access request; the unique identifier of the request is an identifier generated when the user initiates an access request to a preset function of the front-end page; Send a log collection request to the backend server; the log collection request includes a unique identifier of the request, and the unique identifier of the request is used by the backend server to collect the logs generated by all calling methods or applications corresponding to each request to the log platform; each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or application to process historical access requests, and each log contains the unique identifier of the request and the call sequence identifier generated according to the call sequence; The collected logs are grouped according to the request unique identifier and the call sequence identifier, and the logs corresponding to each request and call sequence are obtained for users to query and print.

8. A log collection and printing method, characterized in that: The method is applied to a backend server and includes: Receive a log collection request; the log collection request is a request generated by the log platform when receiving a user's application for printing a log corresponding to a historical access request, and the log collection request includes a unique identifier of the request, which is an identifier generated when the user initiates an access request to a preset function of a front-end page; According to the unique identifier of the request, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform; each collected log is a log generated by the back-end server according to the unique identifier of the request when calling each calling method or application to process historical access requests. Each log contains the request unique identifier and the call sequence identifier generated according to the call sequence. The request unique identifier and the call sequence identifier are used for the log platform to group the collected logs for users to query and print.

9. The method according to claim 8, characterized in that Each collected log is a log generated by the backend server when calling each calling method or applying to process historical access requests, based on the unique identifier of the request, the specified log collection starting position and the specified collection range; each log also includes the specified log collection starting position and the specified collection range; According to the unique identifier of the request, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform, including: according to the unique identifier of the request, the specified log collection starting position and the specified collection range, the logs generated by all calling methods or applications corresponding to each request are collected to the log platform.

10. A log collection and printing system, characterized in that: include: The log platform is used to generate a log collection request according to the unique identifier of the historical access request when receiving a user's application for printing the log corresponding to the historical access request, and send the log collection request to the back-end server; the unique identifier of the request is the identifier generated when the user initiates an access request to the preset function of the front-end page; The collected logs are grouped according to the request unique identifier and the call sequence identifier, and the logs corresponding to each request and call sequence are obtained for users to query and print; The backend server is used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request; Each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or applying historical access requests. Each log contains the unique identifier of the request and the calling sequence identifier generated according to the calling sequence.

11. A log collection and printing log platform, characterized in that: include: A first receiving unit, configured to receive a user's application for printing a log corresponding to a historical access request; A generating unit, used for generating a log collection request according to a unique identifier of a historical access request; The unique identifier of the request is an identifier generated when the user initiates a request to access a preset function of the front-end page; A sending unit is used to send a log collection request to a backend server; the log collection request includes a unique identifier of the request, and the unique identifier of the request is used for the backend server to collect logs generated by all calling methods or applications corresponding to each request to a log platform; each collected log is a log generated by the backend server according to the unique identifier of the request when calling each calling method or application to process a historical access request, and each log includes a unique identifier of the request and a call sequence identifier generated according to the call sequence; The printing processing unit is used to group the collected logs according to the request unique identifier and the calling sequence identifier, and obtain the log corresponding to each request and calling sequence for user query and printing.

12. A log collection and printing backend server, characterized in that: include: A second receiving unit, configured to receive a log collection request; The log collection request is a request generated by the log platform when receiving a user's application for printing a log corresponding to a historical access request. The log collection request includes a unique identifier of the request, which is an identifier generated when the user initiates an access request to a preset function of the front-end page; A collection and processing unit, used to collect logs generated by all calling methods or applications corresponding to each request to a log platform according to the unique identifier of the request; Each collected log is a log generated by the backend server based on the unique identifier of the request when calling each calling method or applying historical access requests. Each log contains the request unique identifier and the call sequence identifier generated according to the calling sequence; the request unique identifier and the call sequence identifier are used by the log platform to group the collected logs for user query and printing.

13. The backend server according to claim 12, characterized in that: Each collected log is a log generated by the backend server when calling each calling method or applying to process historical access requests, based on the unique identifier of the request, the specified log collection starting position and the specified collection range; each log also includes the specified log collection starting position and the specified collection range; The collection and processing unit is specifically used to collect the logs generated by all calling methods or applications corresponding to each request to the log platform according to the unique identifier of the request, the specified log collection starting position and the specified collection range.

14. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

16. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Log data storage method, device and distributed service system

    CN108199876A

  • Interface log acquisition method, interface log management server and business server

    CN110096419A

  • Business log processing method and system

    CN111526060A

  • Distributed call log printing method

    CN113342771A

  • Log processing method, medium, system and computing equipment

    CN114356718A