Application logging methods, apparatus, computer devices, and storage media

By sending configuration information when the application starts and only reporting log information during runtime, the server synthesizes target logs and sends alarms, solving the problems of high traffic consumption and storage space compression in online application quality monitoring and improving efficiency.

CN114238049BActive Publication Date: 2026-03-13CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies for online application quality monitoring suffer from problems such as high traffic consumption, storage space compression, and low system operating efficiency due to the use of data entry points.

Method used

Configuration information is sent when the application starts, and only log information is reported during runtime. The server synthesizes the target log and sends alarm information according to the log level. The complete target log is synthesized by combining configuration information and log information, reducing the duplication of basic information reporting.

Benefits of technology

It saves bandwidth and server storage space, and improves the efficiency of the server in sending alarm information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238049B_ABST
    Figure CN114238049B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, and storage medium for processing application logs. The method includes: acquiring any configuration information sent when any application starts; acquiring any log information sent by any application in response to a triggered event; determining any target log corresponding to the acquired log information based on all acquired configuration information; determining the log level of the target log; and sending an alarm message for the target log based on its log level. This method can save bandwidth, reduce server storage space, and improve the efficiency of server log analysis and alarm message sending.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of application technology, and in particular to application log processing methods, apparatus, computer devices, and storage media. Background Technology

[0002] With the rise of the internet, applications have become an integral part of people's lives. During the development phase, applications undergo unit testing, code scanning, and other tests. During the testing phase, integration testing and user testing are conducted. However, if problems arise during user interaction after the application is launched, it is considered a serious issue. Therefore, online quality monitoring of the application is necessary.

[0003] Currently, online quality monitoring of applications can be achieved through event tracking. By adding event tracking code to the logic that needs to be tracked, the variable values ​​of the current environment are recorded, enabling debugging and tracking of event content to obtain logs for quality monitoring. However, this involves a large amount of development work, and a large number of logs are acquired and saved during monitoring. Later, a large number of logs are inspected to identify application defects. Acquiring and saving a large number of logs results in huge traffic consumption and compresses system storage space, leading to low system operating efficiency. Summary of the Invention

[0004] Therefore, it is necessary to provide log processing methods, devices, computer equipment, and storage media for applications that can save bandwidth, save server storage space, and improve the efficiency of server log analysis and alarm information sending in response to the above-mentioned technical problems.

[0005] A method for processing logs in an application, the method comprising:

[0006] Retrieve any configuration information sent when any application starts;

[0007] Retrieve any log information sent by any application in response to a triggered event;

[0008] Based on all the acquired configuration information, determine any target log corresponding to any log information;

[0009] Determine the log level of any target log, and send an alarm message for any target log based on the log level of the target log.

[0010] In one embodiment, the log information is obtained by any application generating multiple log field information in a preset field order in response to a triggering event, and configuring a first device identifier for the multiple log field information, wherein the first device identifier is the identifier of the device running the application.

[0011] In one embodiment, any of the configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier.

[0012] In one embodiment, determining any target log corresponding to any log information based on all acquired configuration information includes:

[0013] Obtain the first device identifier and the first application identifier of any of the log information;

[0014] Based on the first device identifier and the first application identifier, target configuration information that matches any of the log information is determined from all the acquired configuration information, wherein the second device identifier of the target configuration information is consistent with the first device identifier, and the second application identifier of the target configuration information is consistent with the first application identifier;

[0015] The log information and the target configuration information are combined to obtain any target log corresponding to the log information.

[0016] In one embodiment, sending the alarm information for any target log based on the log level of any target log includes:

[0017] If the log level of any of the target logs is the first level, then a first alarm message is sent based on any of the target logs;

[0018] If the log level of any target log is the second level, then obtain the first candidate log set corresponding to the target log, and send the second alarm information according to the first candidate log set and the target log;

[0019] If the log level of any target log is the third level, then the target log is placed in the second candidate log set corresponding to the target log. If the number of logs in the second candidate log set reaches a threshold, then a third alarm message is sent based on the second candidate log set.

[0020] In one embodiment, sending the second alarm information based on the first candidate log set and any of the target logs includes:

[0021] Obtain the target service identifier of any target log, and determine whether the target service identifier meets preset conditions based on the first candidate log set;

[0022] If the target service identifier meets the preset condition, then any target log is placed in the first candidate log set. If the number of logs in the first candidate log set reaches the threshold, then a second alarm message is sent based on the first candidate log set.

[0023] If the target service identifier does not meet the preset conditions, a second alarm message is sent based on any target log.

[0024] In one embodiment, the preset condition includes: the first candidate log set does not include logs corresponding to the target service identifier; or,

[0025] The first candidate log set includes logs corresponding to the target service identifier, and the target application is not online.

[0026] A log processing apparatus for an application, the apparatus comprising:

[0027] The configuration information acquisition module is used to acquire any configuration information sent by any application when it starts.

[0028] The log information acquisition module is used to acquire any log information sent by any application in response to a triggered event;

[0029] The target log determination module is used to determine any target log corresponding to any log information based on all the acquired configuration information.

[0030] The alarm module is used to determine the log level of any target log and send alarm information for any target log based on the log level of the target log.

[0031] In one embodiment, the log information is obtained by any application generating multiple log field information in a preset field order in response to a triggering event, and configuring a first device identifier for the multiple log field information, wherein the first device identifier is the identifier of the device running the application.

[0032] In one embodiment, any of the configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier.

[0033] In one embodiment, the target log determination module includes:

[0034] The first processing unit is configured to obtain the first device identifier and the first application identifier of any of the log information;

[0035] The second processing unit is configured to determine, based on the first device identifier and the first application identifier, target configuration information that matches any of the log information from all the acquired configuration information, wherein the second device identifier of the target configuration information is consistent with the first device identifier, and the second application identifier of the target configuration information is consistent with the first application identifier;

[0036] The third processing unit is used to synthesize the any log information and the target configuration information to obtain any target log corresponding to the any log information.

[0037] In one embodiment, the alarm module includes:

[0038] The first alarm unit is used to send a first alarm message based on any target log if the log level of any target log is the first level.

[0039] The second alarm unit is used to obtain the first candidate log set corresponding to any target log if the log level of any target log is the second level, and send the second alarm information according to the first candidate log set and the target log.

[0040] The third alarm unit is used to place any target log into the second candidate log set corresponding to any target log if the log level of any target log is the third level, and to send a third alarm message based on the second candidate log set if the number of logs in the second candidate log set reaches a threshold.

[0041] In one embodiment, the second alarm unit includes:

[0042] The first subunit is used to obtain the target service identifier of any target log and determine whether the target service identifier meets preset conditions based on the first candidate log set.

[0043] The second subunit is used to place any target log into the first candidate log set if the target service identifier meets the preset conditions, and to send a second alarm message based on the first candidate log set if the number of logs in the first candidate log set reaches the threshold.

[0044] The third subunit is used to send a second alarm message based on any target log if the target service identifier does not meet the preset conditions.

[0045] In one embodiment, the preset condition includes: the first candidate log set does not include logs corresponding to the target service identifier; or,

[0046] The first candidate log set includes logs corresponding to the target service identifier, and the target application is not online.

[0047] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0048] Retrieve any configuration information sent when any application starts;

[0049] Retrieve any log information sent by any application in response to a triggered event;

[0050] Based on all the acquired configuration information, determine any target log corresponding to any log information;

[0051] Determine the log level of any target log, and send an alarm message for any target log based on the log level of the target log.

[0052] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0053] Retrieve any configuration information sent when any application starts;

[0054] Retrieve any log information sent by any application in response to a triggered event;

[0055] Based on all the acquired configuration information, determine any target log corresponding to any log information;

[0056] Determine the log level of any target log, and send an alarm message for any target log based on the log level of the target log.

[0057] The above-mentioned application log processing method, apparatus, computer equipment, and storage medium, wherein the configuration information is application-related basic information that is not easily changed, and the log information is log information generated by the application during operation. When the application starts, the configuration information is sent to the server. During application operation, it is not necessary to repeatedly report application-related basic information; only the log information generated by the application during operation needs to be reported. The server will synthesize a complete target log based on the configuration information and the log information. Through the above-mentioned application log processing method, the online quality of the application can be monitored, saving traffic, saving server storage space, and improving the efficiency of the server in sending alarm information based on the target log. Attached Figure Description

[0058] Figure 1 This is an application environment diagram of the log processing method of an application in one embodiment;

[0059] Figure 2 This is a flowchart illustrating the log processing method of an application in one embodiment;

[0060] Figure 3 This is a schematic diagram of the view tree of a page in one embodiment;

[0061] Figure 4 This is a schematic diagram of the process of sending a second alarm message for a target log of the second level in another embodiment;

[0062] Figure 5 This is a structural block diagram of the log processing device of an application in one embodiment;

[0063] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0065] In the field of software testing, there is a well-known principle: software testing can only confirm the existence of defects in software, but it cannot prove that defects are not present. In other words, software testing can only reduce the likelihood of defects, but it cannot completely eliminate them. With the rise of mobile internet in recent years, applications have become integrated into people's lives. Whether it's WeChat, Alipay, Douyin, Toutiao, or even various services from banks and telecommunications companies, they can all be handled by installing corresponding applications on the client side.

[0066] For applications, business requirements iterate rapidly, requiring adaptation to various types of devices from different terminal brands, and striving for a similar or even consistent user experience across different mobile operating systems. Quality management is a critical aspect of development.

[0067] Generally speaking, online issues in applications are considered serious problems, especially for applications with multiple online and offline business scenarios and a public-facing audience. Continuous improvement of software quality standards is crucial in these cases. Therefore, in addition to unit testing and code reviews during development, and integration and user testing during testing, effectively identifying online issues, automatically classifying and assigning them, and tracking their resolution become key to improving application quality.

[0068] Currently, online quality monitoring of applications can be achieved through event tracking. By adding event tracking code to the logic that needs to be tracked, the variable values ​​of the current environment are recorded, enabling debugging and tracking of event content to obtain logs for quality monitoring. However, this involves a large amount of development work, and a large number of logs are acquired and saved during monitoring. Later, a large number of logs are inspected to identify application defects. Acquiring and saving a large number of logs results in huge traffic consumption and compresses system storage space, leading to low system operating efficiency.

[0069] The log processing method for applications provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 runs any application. When any application starts, terminal 102 sends configuration information to server 104. When any application responds to a trigger event, terminal 102 sends any log information to server 104. Server 104 determines any target log corresponding to any log information based on all the acquired configuration information and sends alarm information according to the log level of any target log. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0070] In one embodiment, such as Figure 2 As shown, a log processing method for an application is provided, which is applied to... Figure 1 Taking the server in the example, the following steps are included:

[0071] S101. Obtain any configuration information sent when any application starts.

[0072] Wherein, any configuration information refers to basic information corresponding to any application that is not easily changed. Any configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier. The second device identifier is a unique identifier for the device running the application, and the device running the application can be identified through the second device identifier; the system version number is the system version number of the device corresponding to the second device identifier; the user identity identifier is the account used by the user using the application; the application version number is the version number of the application; and the second application identifier is a unique identifier for the application, and the application can be identified through the second application identifier.

[0073] Specifically, the server obtains any configuration information sent when any application running on any device starts up; in other words, the server obtains multiple configuration information.

[0074] S102. Obtain any log information sent by any application in response to a triggered event.

[0075] Specifically, the triggering event is used to trigger the reporting of log information. The triggering event can be a user's click operation, swipe operation, or other similar event. When an application receives the triggering event, it generates log information and sends it to the server, enabling the server to obtain any log information sent by any application. The "any application" in S102 does not specifically refer to any application in S101; both S101 and S102 refer to any application within the server's jurisdiction.

[0076] S103. Based on all the acquired configuration information, determine any target log corresponding to any log information.

[0077] Specifically, after receiving any log information, the server determines the target configuration information corresponding to that log information from all the acquired configuration information, and then determines the target log based on the determined target configuration information and the log information. Each time any log information is acquired, the target log for that log information is determined.

[0078] For example, any configuration information received by the server includes: p1, p2, p3, ..., pn. The server obtains any log information, r1. It determines the target configuration information corresponding to r1 from p1, p2, p3, ..., pn. Assuming that the target configuration information corresponding to r1 is p3, the target log corresponding to r1 is determined based on r1 and p3.

[0079] S104. Determine the log level of any target log, and send alarm information for any target log based on the log level of the target log.

[0080] Specifically, in the target log, the log level of Task 1 log can be obtained. The log level includes: first level, second level and third level. If the log level of any target log is first level, an alarm message is sent directly. If the log level of any target log is second level and meets the preset conditions, an alarm message is sent. If the log level of any target log is third level and the number of third level logs of any application reaches the threshold, an alarm message is sent.

[0081] In the log processing method of the above application, the configuration information is basic information related to the application that is not easily changed, and the log information is the log information generated by the application during operation. When the application starts, the configuration information is sent to the server. During the operation of the application, it is not necessary to repeatedly report the basic information related to the application. Only the log information generated by the application during operation needs to be reported. The server will synthesize a complete target log based on the configuration information and the log information. Through the log processing method of the above application, the online quality of the application can be monitored, saving traffic, saving server storage space, and improving the efficiency of the server in sending alarm information based on the target log.

[0082] In one embodiment, any log information is obtained by any application generating multiple log field information in a preset field order in response to a triggering event, and configuring a first device identifier for the multiple log field information, wherein the first device identifier is the identifier of the device running the application.

[0083] Specifically, any log information includes multiple fields. In order to improve log processing efficiency and optimize log format, the multiple fields are arranged in a preset field order. Therefore, multiple log field information is generated in a preset field order.

[0084] The preset field order can be: log level field, application identifier field, log category field, business identifier field, and alarm content field.

[0085] The log level field includes a log level, which reflects the defect level of any log information. The log levels include: Level 1 (error), Level 2 (warning), and Level 3 (info).

[0086] The application identifier field is used to write the first application identifier, which is a unique identifier for any application in S102. Any application in S102 can be identified through the first application identifier.

[0087] The log category field is used to write log categories, which reflect the business modules.

[0088] The business identifier field is used to write business identifiers, which can identify unique events.

[0089] The alarm content field is used to write alarm content, which reflects specific alarm information, such as errorcode14: unable to open database file.

[0090] The preset field order can also be set to other orders as needed. For example, the preset field order can be: log level field, alarm content field, application identifier field, log category field, and business identifier field.

[0091] The log levels are also set as required: Level 1 and Level 2, or Level 1, Level 2, Level 3 and Level 4.

[0092] The business identifier is determined based on the view tree corresponding to the triggering event. Each page has a view tree structure, and the business identifier of the triggering event can be determined through the view hierarchy path, such as... Figure 3 As shown, the view tree of the page corresponding to the triggered event is reconstructed through the view's `subview` and `subviews` properties. The top level of the view tree is `UIWindow`, and each view is a child node in the view tree. Child views under a parent view may be different instances, for example, Figure 3 The two UIButtons under the UIView are different instances of the same class; each subview has its own index in the parent view, and the business identifier that triggers the event is determined based on the index of each subview.

[0093] For example, when any application r1 responds to a triggered event, it generates multiple log field information in a preset field order, including:

[0094] Level(error)-AppID(lifeApp)-Type(sale)-BizeID(UIWindow / UIView)-ontent(error code 14:unable to open database file);

[0095] Configure any log information obtained by configuring the first device identifier for multiple log field information:

[0096] DeviceID(EMU125784)-Level(error)-AppID(lifeApp)-Type(sale)-BizeID(UIWindow / UIView)-ontent(error code 14:unable to open database file).

[0097] In this embodiment, multiple log field information is generated according to a preset field order, and the business identifier is determined based on the view tree corresponding to the triggered event. In other words, the log field format and business identifier are unified, which improves the log processing efficiency.

[0098] In one embodiment, S103 includes:

[0099] S310. Obtain the first device identifier and the first application identifier of any of the log information.

[0100] Specifically, any log information obtained by the server is configured with a first device identifier. The first device identifier is obtained, and the first application identifier is obtained from the application identifier field of any log information.

[0101] S311. Based on the first device identifier and the first application identifier, determine the target configuration information that matches any of the log information from all the acquired configuration information.

[0102] Wherein, the second device identifier of the target configuration information is the same as the first device identifier, and the second application identifier of the target configuration information is the same as the first application identifier.

[0103] Specifically, each configuration information obtained by the server includes a second device identifier and a second application identifier. The first device identifier and the first application identifier are matched with the second device identifier and the second application identifier in all configuration information obtained by the server to determine the target configuration information.

[0104] For example, all configuration information obtained by the server includes: configuration information p1 sent by device d1 when starting application a1, configuration information p2 sent by device d1 when starting application a2, configuration information p3 sent by device d1 when starting application a3, configuration information p4 sent by device d2 when starting application a1, configuration information p5 sent by device d2 when starting application a4, and configuration information p6 sent by device d3 when starting application a1; if any log information r1 is sent by device d2 running application a1, then the target configuration information matching r1 can be determined from all configuration information: p4.

[0105] S312. Combine the log information and the target configuration information to obtain the target log corresponding to the log information.

[0106] Specifically, the target configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier. Since any log information already contains a first device identifier (which is the same as the second device identifier in the target configuration information) and a first application identifier (which is the same as the second application identifier in the target configuration information), it is only necessary to obtain the system version number, user identity identifier, and application version number from the target configuration information, and combine them with any log information. This allows the system version number, user identity identifier, and application version number from the target configuration information to be written into the alarm field of any log information.

[0107] For example, any log information includes:

[0108] DeviceID(EMU125784)-Level(error)-AppID(lifeApp)-Type(sale)-BizeID(UIWindow / UIView)-content(error code 14:unable to open database file);

[0109] The target configuration information includes: DeviceID (EMU1000542784) - Sys Version NUM (Android 6.0.1) - userID (254852694) - App Version NUM (4.2.1) - AppID (lifeApp);

[0110] Write the system version number, user identity identifier, and application version number from the target configuration information into the alarm field of any log message. The resulting target log includes:

[0111] DeviceID(EMU125784)-Level(error)-AppID(lifeApp)-Type(sale)-BizeID(UIWi ndow / UIView)-content(Android 6.0.1; 254852694; 4.2.1; error code 14:unableto open database file).

[0112] In this embodiment, the configuration information is application-related information that is not easily changed, and the log information is the log information generated by the application during operation. When the application starts, the configuration information is sent to the server. During the operation of the application, it is not necessary to repeatedly report the basic information related to the application. Only the log information generated by the application during operation needs to be reported. The server will synthesize a complete target log based on the configuration information and the log information, which saves traffic, saves server storage space, and improves the efficiency of the server in sending alarm information based on the target log.

[0113] In one embodiment, S104 includes:

[0114] S410. If the log level of any target log is the first level, then send the first alarm information based on the target log.

[0115] Specifically, a Level 1 error indicates the highest level of problem encountered by the application, which is highly likely to be an online issue, and in this case, a first alert message is immediately sent. This first alert message includes any of the target logs mentioned above.

[0116] In one implementation, the first alarm information includes any target log and a first analysis report of any application corresponding to the target log. Specifically, all logs of any application corresponding to the target log are obtained, and a first analysis report is determined based on all logs of the application. The first analysis report includes a first aggregation view and a first detail view. The first aggregation view includes the number of logs of different levels and the number of logs of different business identifiers. The first detail view includes specific information of each log.

[0117] S411. If the log level of any target log is the second level, the first candidate log set corresponding to any target log is selected, and a second alarm message is sent according to the first candidate log set and the target log, wherein the target application is the application corresponding to any target log.

[0118] Specifically, the second level, warning, represents a minor issue in the application and is not necessarily an online problem. However, if it occurs repeatedly, it may evolve into an online problem. Therefore, if any target log has a second level log level, an alarm message will not be sent immediately. Instead, a first candidate log set for the target log will be obtained. The first candidate log set includes all second level logs of the application corresponding to the target log. A second alarm message will be sent based on the first candidate log set and the target log.

[0119] In one embodiment, S411 includes:

[0120] S420. Obtain the target service identifier of any target log, and determine whether the target service identifier meets the preset conditions based on the first candidate log set.

[0121] Specifically, the target service identifier is obtained from the service identifier field of any target log. The preset conditions include: the first candidate log set does not include the log corresponding to the target service identifier; or, the first candidate log set includes the log corresponding to the target service identifier, and the target application is not online.

[0122] If the first candidate log set does not include the log corresponding to the target service identifier, it indicates that the problem with the target service identifier is a new problem that has not appeared before; if the first candidate log set includes the log corresponding to the target service identifier, it indicates that the problem with the target service identifier is an old problem that has appeared before; the target program is not in an online state. Determining whether the target service identifier meets the preset conditions based on the first candidate log set means determining whether the problem with the target service identifier is a new problem, or, if the problem with the target service identifier is an old problem, whether the problem with the target service identifier is an online problem.

[0123] S421. If the target service identifier meets the preset condition, then any target log is placed in the first candidate log set. If the number of logs in the first candidate log set reaches the threshold, then a second alarm message is sent based on the first candidate log set.

[0124] Specifically, if the problem with the target service identifier is a new problem, or if the problem with the target service identifier is an old problem but not an online problem, then any target log will be added to the first candidate log set. If the number of logs in the first candidate log set (including any target log) reaches a threshold, it indicates that the number of second-level problems with the target service identifier has reached the threshold, which may lead to online problems, and a second alarm message will be sent based on the first candidate log set.

[0125] The second alarm information includes a second analysis report of the first candidate log set. Specifically, the first candidate log set is analyzed to obtain a second analysis report of the first candidate log set. The second analysis report includes a second aggregate view and a second detailed view. The second aggregate view includes the number of different service identifiers appearing in the first candidate log set, and the second detailed view includes detailed information of each log in the first candidate log set.

[0126] S423. If the target service identifier does not meet the preset conditions, a second alarm message is sent based on any target log.

[0127] Specifically, if the target service identifier does not meet the preset conditions, it indicates that the target service identifier is an old problem and the target application is online, then a second alarm message is immediately sent. The second alarm message includes the target log.

[0128] like Figure 4 As shown, for a second-level target log, the process of sending a second alarm message includes the following steps:

[0129] 10. Determine the target log for the second level of the application;

[0130] 11. Obtain the target business identifier from the target log;

[0131] 12. Determine whether the problem identified by the target business identifier is a new problem. If yes, proceed to step 13; otherwise, proceed to step 15.

[0132] 13. Add the target service identifier to the first candidate log set;

[0133] 14. Determine whether the number of logs in the first candidate log set has reached the threshold. If it has reached the threshold, proceed to step 17; otherwise, proceed to step 18.

[0134] 15. Determine if the application is online. If yes, proceed to step 16; otherwise, proceed to step 18.

[0135] 16. Send a second alarm message based on the target log;

[0136] 17. Send the second alarm message based on the first candidate log set;

[0137] 18. End.

[0138] S412. If the log level of any target log is the third level, then the target log is placed in the second candidate log set corresponding to the target log. If the number of logs in the second candidate log set reaches the threshold, then a third alarm message is sent based on the second candidate log set.

[0139] Specifically, the third level, Info, is a low-level issue. It is not an online issue and will not be reported immediately. Instead, it will be reported after a certain number of occurrences. In other words, if any target log has a third-level log, it will be directly placed into the second candidate log set. The second candidate log set includes all third-level logs of the application corresponding to the target log. If the number of logs in the second candidate log set reaches a threshold, a third alarm message will be sent.

[0140] The third alarm information includes: a third analysis report of the second candidate log set; specifically, the second candidate log set is analyzed to obtain a third analysis report of the second candidate log set. The third analysis report includes: a third aggregate view and a third detailed view. The third aggregate view includes: the number of different service identifiers appearing in the second candidate log set. The third detailed view includes: detailed information of each log in the second candidate log set.

[0141] In one embodiment, the server includes a log analysis module for obtaining a first analysis report, a second analysis report, and a third analysis report. The log analysis module can use a time-series database to facilitate data analysis. At the implementation level, InfluxDB is used. InfluxDB is an open-source distributed time-series, event, and metrics database developed using the Go programming language, suitable for log processing. InfluxDB provides a rich set of query functions that greatly simplify data analysis. For example, the InfluxDB function `count` returns the number of records for a given field, allowing you to retrieve the number of logs at different levels or with different business identifiers.

[0142] In one embodiment, the first, second, and third alarm messages can be sent to a backend server so that backend staff can understand the application's problems based on the alarm information. Backend staff can process the alarm messages and add processing statuses, including: pending processing, in progress, awaiting release, live, and no processing required. Alternatively, the alarm messages can be directly sent to pre-defined backend staff.

[0143] In one embodiment, the server stores target logs for each application. For any application, at preset intervals, a periodic report is generated based on multiple target logs of the application within the preset interval, and a notification is sent to a designated platform, such as WeChat Work or DingTalk. The notification includes the periodic report, or the notification includes a link to the periodic report, through which the periodic report can be queried.

[0144] In one embodiment, the server sends the alarm information to a defect tracking platform, which then handles defect creation, allocation, follow-up, and data reporting. The server includes a defect tracking module for tracking alarm information. This module interfaces with existing defect tracking platforms, which can be implemented using open-source tools like Mantis and Bugzilla, or SaaS platforms such as Jira and PingCode. These open-source tools and SaaS platforms enable defect creation, allocation, follow-up, and data reporting. By interfacing with existing defect tracking platforms, the entire process from alarm to defect tracking is achieved.

[0145] In the above embodiments, a complete end-to-end process for application quality management is provided, encompassing log collection, alarm reporting, and defect tracking. During log collection, logs are reported in segments. Configuration information is sent to the server upon application startup. During application runtime, it is unnecessary to repeatedly report basic application information; only the log information generated during application operation needs to be reported. The server synthesizes a complete target log based on the configuration information and the log information. This application log processing method monitors the online quality of the application, saving bandwidth, server storage space, and improving the efficiency of the server in sending alarm information based on the target log. During alarm reporting, different solutions are used for different log levels, making alarm reporting more rational and standardized. Combined with a defect tracking platform, defects are tracked, reducing manual processing and improving efficiency. Through this end-to-end process including log collection, alarm reporting, and defect tracking, a more timely and accurate understanding of application quality can be achieved, continuously reducing the number of application defects, shortening the average defect detection time, and ultimately improving the application's ability to serve users and optimizing the user experience.

[0146] It should be understood that, although Figure 2 and Figure 4 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 and Figure 4 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0147] In one embodiment, such as Figure 5 As shown, an application log processing device is provided, including: a configuration information acquisition module, a log information acquisition module, a target log determination module, and an alarm module, wherein:

[0148] The configuration information acquisition module is used to acquire any configuration information sent by any application when it starts.

[0149] The log information acquisition module is used to acquire any log information sent by any application in response to a triggered event;

[0150] The target log determination module is used to determine any target log corresponding to any log information based on all the acquired configuration information.

[0151] The alarm module is used to determine the log level of any target log and send alarm information for any target log based on the log level of the target log.

[0152] The log information is obtained by any application responding to a trigger event by generating multiple log field information in a preset field order and configuring a first device identifier for the multiple log field information. The first device identifier is the identifier of the device running the application.

[0153] The configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier.

[0154] The target log determination module includes: a first processing unit, a second processing unit, and a third processing unit, wherein:

[0155] The first processing unit is configured to obtain the first device identifier and the first application identifier of any of the log information;

[0156] The second processing unit is configured to determine, based on the first device identifier and the first application identifier, target configuration information that matches any of the log information from all acquired configuration information, wherein the second device identifier of the target configuration information is consistent with the first device identifier, and the second application identifier of the target configuration information is consistent with the first application identifier;

[0157] The third processing unit is used to synthesize the any log information and the target configuration information to obtain any target log corresponding to the any log information.

[0158] The alarm module includes a first alarm unit, a second alarm unit, and a third alarm unit, wherein:

[0159] The first alarm unit is used to send a first alarm message based on any target log if the log level of any target log is the first level.

[0160] The second alarm unit is configured to, if the log level of any target log is the second level, obtain the first candidate log set corresponding to the target log, and send a second alarm message according to the first candidate log set and the target log, wherein the target application is the application corresponding to the target log;

[0161] The third alarm unit is used to place any target log into the second candidate log set corresponding to any target log if the log level of any target log is the third level, and to send a third alarm message based on the second candidate log set if the number of logs in the second candidate log set reaches a threshold.

[0162] The second alarm unit includes a first subunit, a second subunit, and a third subunit, wherein:

[0163] The first subunit is used to obtain the target service identifier of any target log and determine whether the target service identifier meets preset conditions based on the first candidate log set;

[0164] The second subunit is used to place any target log into the first candidate log set if the target service identifier meets the preset conditions, and to send a second alarm message based on the first candidate log set if the number of logs in the first candidate log set reaches the threshold.

[0165] The third subunit is used to send a second alarm message based on any target log if the target service identifier does not meet the preset conditions.

[0166] The preset conditions include: the first candidate log set does not include logs corresponding to the target service identifier; or...

[0167] The first candidate log set includes logs corresponding to the target service identifier, and the target application is not online.

[0168] Specific limitations regarding the application's logging device can be found in the above description of the application's logging methods, and will not be repeated here. Each module in the aforementioned application's logging device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independent of the processor in the computer device, or stored in software in the computer device's memory, so that the processor can invoke and execute the corresponding operations of each module.

[0169] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores data required by the application's log processing method. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an application's log processing method.

[0170] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0171] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0172] Retrieve any configuration information sent when any application starts;

[0173] Retrieve any log information sent by any application in response to a triggered event;

[0174] Based on all the acquired configuration information, determine any target log corresponding to any log information;

[0175] Determine the log level of any target log, and send an alarm message for any target log based on the log level of the target log.

[0176] In one embodiment, any log information is obtained by any application responding to a triggering event by generating multiple log field information in a preset field order and configuring a first device identifier for the multiple log field information, wherein the first device identifier is the identifier of the device running the application; any configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier; when the processor executes the computer program, it further implements the following steps:

[0177] Obtain the first device identifier and the first application identifier of any of the log information;

[0178] Based on the first device identifier and the first application identifier, target configuration information that matches any of the log information is determined from all the acquired configuration information, wherein the second device identifier of the target configuration information is consistent with the first device identifier, and the second application identifier of the target configuration information is consistent with the first application identifier;

[0179] The log information and the target configuration information are combined to obtain any target log corresponding to the log information.

[0180] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0181] If the log level of any of the target logs is the first level, then a first alarm message is sent based on any of the target logs;

[0182] If the log level of any target log is the second level, then obtain the first candidate log set corresponding to the target log, and send the second alarm information according to the first candidate log set and the target log, wherein the target application is the application corresponding to the target log;

[0183] If the log level of any target log is the third level, then the target log is placed in the second candidate log set corresponding to the target log. If the number of logs in the second candidate log set reaches a threshold, then a third alarm message is sent based on the second candidate log set.

[0184] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0185] Obtain the target service identifier of any target log, and determine whether the target service identifier meets preset conditions based on the first candidate log set;

[0186] If the target service identifier meets the preset condition, then any target log is placed in the first candidate log set. If the number of logs in the first candidate log set reaches the threshold, then a second alarm message is sent based on the first candidate log set.

[0187] If the target service identifier does not meet the preset conditions, a second alarm message is sent based on any target log.

[0188] The preset conditions include: the first candidate log set does not include logs corresponding to the target service identifier; or...

[0189] The first candidate log set includes logs corresponding to the target service identifier, and the target application is not online.

[0190] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0191] Retrieve any configuration information sent when any application starts;

[0192] Retrieve any log information sent by any application in response to a triggered event;

[0193] Based on all the acquired configuration information, determine any target log corresponding to any log information;

[0194] Determine the log level of any target log, and send an alarm message for any target log based on the log level of the target log.

[0195] In one embodiment, any log information is obtained by any application responding to a triggering event by generating multiple log field information in a preset field order and configuring a first device identifier for the multiple log field information, wherein the first device identifier is the identifier of the device running the application; any configuration information includes: a second device identifier, a system version number, a user identity identifier, an application version number, and a second application identifier; when the computer program is executed by the processor, it further implements the following steps:

[0196] Obtain the first device identifier and the first application identifier of any of the log information;

[0197] Based on the first device identifier and the first application identifier, target configuration information that matches any of the log information is determined from all the acquired configuration information, wherein the second device identifier of the target configuration information is consistent with the first device identifier, and the second application identifier of the target configuration information is consistent with the first application identifier;

[0198] The log information and the target configuration information are combined to obtain any target log corresponding to the log information.

[0199] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0200] If the log level of any of the target logs is the first level, then a first alarm message is sent based on any of the target logs;

[0201] If the log level of any target log is the second level, then obtain the first candidate log set corresponding to the target log, and send the second alarm information according to the first candidate log set and the target log, wherein the target application is the application corresponding to the target log;

[0202] If the log level of any target log is the third level, then the target log is placed in the second candidate log set corresponding to the target log. If the number of logs in the second candidate log set reaches a threshold, then a third alarm message is sent based on the second candidate log set.

[0203] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0204] Obtain the target service identifier of any target log, and determine whether the target service identifier meets preset conditions based on the first candidate log set;

[0205] If the target service identifier meets the preset condition, then any target log is placed in the first candidate log set. If the number of logs in the first candidate log set reaches the threshold, then a second alarm message is sent based on the first candidate log set.

[0206] If the target service identifier does not meet the preset conditions, a second alarm message is sent based on any target log.

[0207] The preset conditions include: the first candidate log set does not include logs corresponding to the target service identifier; or...

[0208] The first candidate log set includes logs corresponding to the target service identifier, and the target application is not online.

[0209] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0210] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0211] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A log processing method of an application program, characterized by, The method comprises: acquiring any configuration information sent when any application is started; the any configuration information comprises a second device identifier and a second application identifier; the second device identifier is a unique identifier of a device running the any application, and the second application identifier is a unique identifier of the any application; acquiring any log information sent by the any application in response to a trigger event, and a first device identifier and a first application identifier of the any log information; determining target configuration information matching the any log information from all acquired configuration information based on the first device identifier and the first application identifier, wherein the second device identifier of the target configuration information is consistent with the first device identifier, and the second application identifier of the target configuration information is consistent with the first application identifier; combining the any log information and the target configuration information to obtain any target log corresponding to the any log information; determining a log level of the any target log, and sending alarm information of the any target log based on the log level of the any target log.

2. The method of claim 1, wherein, The any log information is generated by the any application in response to the trigger event, and comprises a plurality of log field information in a preset field order and a first device identifier configured for the plurality of log field information, wherein the first device identifier is an identifier of a device running the any application.

3. The method of claim 1, wherein, The any configuration information further comprises a system version number, a user identity, and an application version number.

4. The method according to any one of claims 1 to 3, characterized in that, The sending of the alarm information of the any target log based on the log level of the any target log comprises: if the log level of the any target log is a first level, sending first alarm information based on the any target log; if the log level of the any target log is a second level, acquiring a first candidate log set corresponding to the any target log, and sending second alarm information according to the first candidate log set and the any target log; if the log level of the any target log is a third level, putting the any target log into a second candidate log set corresponding to the any target log, and sending third alarm information based on the second candidate log set if a number of logs in the second candidate log set reaches a threshold.

5. The method of claim 4, wherein, The sending of the second alarm information according to the first candidate log set and the any target log comprises: acquiring a target service identifier of the any target log, and determining whether the target service identifier satisfies a preset condition based on the first candidate log set; if the target service identifier satisfies the preset condition, putting the any target log into the first candidate log set, and sending the second alarm information based on the first candidate log set if a number of logs in the first candidate log set reaches the threshold; if the target service identifier does not satisfy the preset condition, sending the second alarm information based on the any target log.

6. The method of claim 5, wherein, The preset condition comprises that the first candidate log set does not include a log corresponding to the target service identifier, or The first candidate log set includes logs corresponding to the target service identity, and the target application is not in an online state.

7. A log processing apparatus of an application program, characterized by comprising: The device comprises: The configuration information acquisition module is configured to acquire any configuration information sent when any application is started; the any configuration information comprises a second device identity and a second application identity; the second device identity is a unique identity of a device running the any application, and the second application identity is a unique identity of the any application; The log information acquisition module is configured to acquire any log information sent by the any application in response to a trigger event; The target log determination module is configured to acquire a first device identity and a first application identity of the any log information; based on the first device identity and the first application identity, determine target configuration information matching the any log information from all acquired configuration information, wherein the second device identity of the target configuration information is consistent with the first device identity, and the second application identity of the target configuration information is consistent with the first application identity; and combine the any log information and the target configuration information to obtain any target log corresponding to the any log information; The alarm module is configured to determine a log level of the any target log, and send alarm information of the any target log based on the log level of the any target log.

8. The apparatus of claim 7, wherein, The any log information is generated by generating a plurality of log field information in a preset field order and configuring a first device identity for the plurality of log field information in response to a trigger event by the any application, and the first device identity is an identity of a device running the any application.

9. The apparatus of claim 7, wherein, The any configuration information further comprises a system version number, a user identity, and an application version number.

10. The apparatus of any one of claims 7 to 9, wherein, The alarm module comprises: The first alarm unit is configured to send first alarm information based on the any target log if the log level of the any target log is a first level; The second alarm unit is configured to acquire a first candidate log set corresponding to the any target log and send second alarm information according to the first candidate log set and the any target log if the log level of the any target log is a second level; The third alarm unit is configured to put the any target log into a second candidate log set corresponding to the any target log if the log level of the any target log is a third level, and send third alarm information based on the second candidate log set if the number of logs in the second candidate log set reaches a threshold.

11. The apparatus of claim 10, wherein, The second alarm unit comprises: The first subunit is configured to acquire a target service identity of the any target log and determine whether the target service identity satisfies a preset condition based on the first candidate log set; The second subunit is configured to put the any target log into the first candidate log set if the target service identity satisfies the preset condition, and send second alarm information based on the first candidate log set if the number of logs in the first candidate log set reaches the threshold. The third sub-unit is configured to send a second alarm information based on any target log if the target service identifier does not satisfy the preset condition.

12. The apparatus of claim 11, wherein, The preset condition includes that the target service identifier corresponding log is not included in the first candidate log set; or, The first candidate log set includes the target service identifier corresponding log, and the target application program is not in an online state.

13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor, when executing the computer program, implements the steps of the method in any one of claims 1 to 6.

14. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Distributed container log data processing method and device

    CN111782470A

  • Log processing method and device, computer equipment and storage medium

    CN112306812A