Error log supervision method, device and system and storage medium
By analyzing and positioning the server application error log, it is automatically added to the code line comments and notifying the submitted object, which solves the problems of lagging monitoring, difficulty in positioning and untimely notification in the existing technology, and improves the convenience and efficiency of code maintenance.
Patent Information
- Application Number
- CN202511008894.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-08-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing server-side application error log processing technology has problems such as insufficient real-time monitoring, low error positioning efficiency, difficult code version traceability, lagging notification mechanism, and inconvenient code error log viewing.
By obtaining the error log information of the target business system, parsing the error log using regular expressions or structured log templates, locate the target code line and add comment information, generate a prompt message and notify the code submission object.
It realizes automatic positioning and timely notification of error logs, improves the convenience and efficiency of code maintenance, and reduces the time and labor cost of error detection.
Smart Images

Figure CN120508436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer software monitoring, and in particular to an error log monitoring method, device, system and storage medium. Background Art
[0002] In current software development and maintenance systems, error logs generated during server-side application execution are crucial for troubleshooting. However, existing server-side application error log processing technologies have significant drawbacks, such as low error location efficiency, difficulty tracing code versions, delayed notification mechanisms, and inconvenient code error log viewing. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides an error log monitoring method, device, system, and storage medium that can automatically locate the corresponding code line, add parsed error log information to the comment, and promptly notify the code submitter, thereby improving the convenience of code maintenance.
[0004] In a first aspect, an embodiment of the present invention provides an error log monitoring method, comprising: Obtain error log information of the target business system; Parsing the error log information to determine target parsing information; Locating a code line of the target code according to the target parsing information, and obtaining submission information of the code line, wherein the submission information includes a code submission object; Add comment information to the code line, wherein the comment information includes part or all of the target parsed information; In response to the adding operation of the comment information, a prompt message is sent to the code submission object, where the prompt message includes part or all of the comment information.
[0005] According to some embodiments of the present invention, parsing the error log information to determine target parsing information includes: Based on a preset regular expression or a structured log template, the error log information is parsed to obtain target parsing information, which includes version control information, code location information and error prompt information.
[0006] According to some embodiments of the present invention, locating the code line of the target code according to the target parsing information includes: Access the corresponding code repository according to the preset code repository address; According to the version control information, the API interface of the code repository is called to query the code snapshot of the corresponding version; According to the code location information and the code snapshot, the code line of the target code is located and the submission information of the code line is obtained.
[0007] According to some embodiments of the present invention, adding comment information to the code line includes: Generate comment information based on a preset comment template and the error prompt information, and add the comment information to the code line.
[0008] According to some embodiments of the present invention, adding comment information to the code line further includes at least one of the following: Generate a code hyperlink for the code line according to the preset code repository address and the code location information, and add the code hyperlink to the comment information; Generate a version hyperlink of the target code according to the code repository address and the version control information, and add the version hyperlink to the comment information; A log hyperlink of the error log information is obtained, and the log hyperlink is added to the comment information.
[0009] According to some embodiments of the present invention, obtaining the submission information of the code line includes: Determining the code author of the target code according to the version control information; Determine the project leader based on the project owner of the target code and the merger of the main branch; The code author and the project leader are regarded as code submission objects.
[0010] According to some embodiments of the present invention, in response to the adding operation of the comment information, sending a prompt message to the code submission object includes: In response to the adding operation of the comment information, obtaining the comment information and generating a prompt message according to the comment information; The preset notification service interface is called to send the prompt message to the code submission object.
[0011] In a second aspect, an embodiment of the present invention provides an error log monitoring device, comprising: Log acquisition module, used to obtain error log information of the target business system; A log parsing module, configured to parse the error log information and determine target parsing information; A code locating module, configured to locate a code line of a target code according to the target parsing information, and obtain submission information of the code line, wherein the submission information includes a code submission object; A comment adding module, configured to add comment information to the code line, wherein the comment information includes part or all of the target parsed information; The message notification module is used to send a prompt message to the code submission object in response to the adding operation of the comment information, where the prompt message includes part or all of the comment information.
[0012] In a third aspect, an embodiment of the present invention provides an error log monitoring system, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to implement the above-mentioned error log monitoring method when running the computer program.
[0013] In a fourth aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed, the above-mentioned error log supervision method is implemented.
[0014] The embodiments of the present invention have at least the following beneficial effects: Obtain the error log information of the target business system; parse the error log information to determine the target parsing information; locate the code line of the target code based on the target parsing information, and obtain the submission information of the code line, the submission information including the code submission object; add comment information to the code line, the comment information including part or all of the target parsing information; in response to the addition of the comment information, send a prompt message to the code submission object, the prompt message including part or all of the comment information. In this way, the corresponding code line can be automatically located, and the parsed error log information can be added to the comment, and the code submission object can be notified in a timely manner, which is conducive to improving the convenience of code maintenance.
[0015] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which: Figure 1 A flowchart of the steps of the error log monitoring method according to an embodiment of the present invention; Figure 2 A schematic diagram of a prompt message according to an embodiment of the present invention; Figure 3 This is a functional block diagram of an error log monitoring device according to an embodiment of the present invention; Figure 4 This is an example principle block diagram of an error log monitoring system according to an embodiment of the present invention; Figure 5This is an interactive flow chart of the error log monitoring system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0018] In the description of the present invention, "several" means one or more, "multiple" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, and "above," "below," and "within" are understood to include the number itself. The use of terms such as "first" and "second" is solely for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly specifying the number of the indicated technical features, or implicitly specifying the order of the indicated technical features.
[0019] In the current software development and operation and maintenance system, error logs generated during the operation of server-side applications are the key basis for troubleshooting. However, existing server-side application error log processing technology has significant flaws: Insufficient real-time monitoring: Traditional error log viewing methods rely heavily on regular manual checks and are unable to achieve real-time monitoring of error logs. This results in a serious lag in error discovery, greatly impacting the normal and stable operation of services.
[0020] Low error location efficiency: Even if error logs are found, it is extremely difficult to analyze and locate the erroneous code location from the massive amount of log information, which requires a lot of time and manpower costs.
[0021] Difficulty in tracing code versions: After an error occurs, due to the lack of relevant information about the code repository, it is difficult to quickly trace the code version status at the time of the error. This is not only not conducive to completely solving the problem, but also hinders subsequent optimization work.
[0022] Delayed notification mechanism: Error information cannot be notified to relevant programming and maintenance personnel in a timely and accurate manner, which significantly prolongs the problem-solving cycle.
[0023] Inconvenient to view code error logs: Running code is usually stored in the code repository, while error information is usually stored in the log system. When performing code maintenance, maintenance personnel need to switch back and forth between the code repository and the log system, which makes it inconvenient to view the corresponding error logs during code maintenance.
[0024] To this end, this embodiment proposes an error log supervision method that can automatically locate the corresponding code line, add the parsed error log information to the comment, and promptly notify the code submission object, which is conducive to improving the convenience of code maintenance.
[0025] Please refer to Figure 1 This embodiment discloses an error log monitoring method, including steps S100 to S500. It should be noted that the steps in this embodiment are numbered only for ease of review and understanding, and do not limit the order in which the steps are executed. The following details the contents of each step: S100, obtaining error log information of the target business system; In an exemplary embodiment, the target business system is the system to be monitored, such as a server-side application. During actual operation, due to factors such as complex business logic and changes in the external environment, the target business system inevitably generates various errors. These errors are output as logs. By collecting the target business system's operational log information, the target business system's operational status can be monitored in real time. The target business system's log information includes various types, including error logs. Obtaining the target business system's error log information can provide a basis for troubleshooting. Log information can be obtained through a logging system. An example of a logging system is Alibaba Cloud's Log Service (SLS), which offers high reliability, scalability, and powerful data processing capabilities. It can stably store massive amounts of log information and provide efficient data retrieval, query, and monitoring functions, providing a data storage foundation for subsequent analysis and processing of error logs. In some application examples, during the build and release phases of the target business system, configuration is performed using a build tool, such as Maven, Feiliu, or Kubernetes. The build artifacts embed metadata about the code repository, such as the repository address (URL, a unique address identifier) and version control information. For example, in a specific application example, the code repository uses a GitLab repository. The version control information of the code repository can be CommitId. CommitId is a unique identifier generated by the GitLab repository each time the code is submitted, which is used to track version changes. Of course, in actual applications, different code repositories can be used, and one or more code repositories can be configured. Different code repositories are configured with different metadata. Error log information can be collected through WebHook technology for further processing. WebHook is a method of adding or changing the appearance of a web page through a custom callback function. In other words, WebHook is also a URL for receiving HTTP POST (or GET, PUT, DELETE and other request methods).
[0026] S200, parsing the error log information to determine target parsing information; Exemplarily, the recorded content of the error log information covers the project name, operating environment, error stack, metadata of the code repository, code location information, and error prompt information, etc., wherein the code location information includes the file path and line number, and the file path can be the method name of the function module or the file name of the function module. The error prompt information includes the error type, the time when the error occurred, and key log fragments and other information. By parsing the error log information, the required content can be extracted from the error log information to obtain the target parsing information, so as to facilitate subsequent code location and the addition of comment information. By combining the error log with the metadata and code location information of the code repository, it is possible to extract key information from the error log information and automatically locate the specific line of code, which is conducive to improving the efficiency of error location, saving error troubleshooting time, and reducing the probability of errors.
[0027] S300, locating the code line of the target code according to the target parsing information, and obtaining the submission information of the code line, the submission information including the code submission object; For example, during the software development process, the target business system usually has multiple different iterative versions. Even for the same version, there may be multiple iterative updates between different modules of the system, resulting in multiple different versions of code in the code repository. If the location of the error code is manually located, it takes a lot of time and effort, and it is easy to have version positioning errors, resulting in the problem of not being able to accurately locate the corresponding code line. This embodiment locates the code line of the target code based on the target parsing information, and the positioning efficiency and accuracy are relatively high. After locating the code line of the target code, the commit information of the code line can be obtained. For example, in the GitLab warehouse, the commit information (Commit) of the code line can be queried using the git blame API interface, thereby querying the commit record of the line of code in the historical version, and then obtaining detailed commit information, such as the code submission object and submission time, etc., so as to determine the person who handles the code maintenance.
[0028] S400, adding comment information to the code line, where the comment information includes part or all of the target parsed information; For example, in the traditional code maintenance process, it is necessary to switch back and forth between the code repository and the log system, which is inconvenient for maintenance personnel to view the code and error logs. The code repository has its own comment function. By adding comment information to the code line, the target parsing information extracted based on the error log information can be associated with the code line, making it convenient for maintenance personnel to view content related to the error log information during the code maintenance process. In some application examples, the content of the comment information may include error core information, navigation links, version metadata, and intelligent solutions, etc., wherein the error core information can be extracted based on the target parsing information, such as the error type, occurrence time, and key log fragments in the error prompt information; the navigation link provides a code hyperlink to the code line and a log hyperlink to the error log information, which is convenient for maintenance personnel to quickly locate and view related content; the version metadata records information such as submission description and submission time, which is convenient for version tracing; the intelligent solution is a targeted solution suggestion generated based on the error type in the error log information to improve the efficiency of code maintenance. In addition, there may be multiple versions of code in the code repository. Adding comment information to the code lines can serve as error markers and prompts. Maintenance personnel can determine the number and location of erroneous code lines by viewing the comment information in the same code, so as to facilitate unified modification. If no comment information is found in the code lines in the opened code, it means that the current version of the code is inconsistent with the version of the erroneous code, which can serve as a prompt to avoid inconsistent code versions during the maintenance process, which is conducive to improving the correctness of code maintenance.
[0029] S500: In response to the comment information adding operation, a prompt message is sent to the code submission object, where the prompt message includes part or all of the comment information.
[0030] For example, by monitoring the comment events of the code repository in real time, when a comment information is added to a code line, the API interface of the notification service is called to send a prompt message to the code submission object, and the information is promptly delivered to the relevant responsible person. The prompt message includes part or all of the comment information. For example, the prompt message includes version control information, code location information and error prompt information. For example, the prompt message also includes navigation links, such as code hyperlinks for code lines and log hyperlinks for error log information. Maintenance personnel can jump to the corresponding code line or error log details page by clicking the navigation link for easy viewing.
[0031] Through the above solution, the corresponding code line can be automatically located, and the parsed error log information can be added to the comment, and the code submission object can be notified in time, which is conducive to improving the convenience of code maintenance.
[0032] Step S200: Parse the error log information to determine target parsing information, including: Based on a preset regular expression or structured log template, the error log information is parsed to obtain target parsing information, which includes version control information, code location information, and error prompt information.
[0033] For example, part of the error log information is as follows: 2025-06-12 10:30:00 ERROR [Service] NullPointerException: null objectaccess at Service.java:128 (commit: 1a2b3c4d) The preset regular expressions can be used to match specific fields in the error log information to extract relevant information. For example, the target parsing content is shown in Table 1: Table 1 Among them, version control information can be represented by the commitId field; code location information can be a combination of file path and line number; error prompt information includes error type, occurrence time, and error summary. In some application examples, the error summary in the error prompt information can be replaced with a key log fragment, or the error prompt information also includes a key log fragment. It should be noted that the above only shows one example of error log information. Depending on the programming language, the error log information generated by the target business system may be different. For example, for the error stack, the Java language uses the class name + method name + line number method, while the Python language uses Traceback information. For error log information in different programming languages, different regular expressions can be constructed, or structured log templates can be used to parse the error log information, so as to adapt to different programming languages and accurately extract the corresponding content.
[0034] In step S300, locating the target code line according to the target parsing information includes: Access the corresponding code repository according to the preset code repository address; Based on the version control information, call the code repository API to query the code snapshot of the corresponding version; Based on the code location information and code snapshot, locate the code line of the target code and obtain the commit information of the code line.
[0035] Exemplarily, the target business system has embedded metadata of the code repository during the construction and release phases. Thus, when the target business system generates log information, the log information carries the code repository address and the version control information of the target code. According to the code repository address, the corresponding code repository can be accessed. Of course, in other application examples, the code repository address can be configured in the log system, so that the log system can access the code repository according to the pre-configured code repository address. Version control information, such as commitId, is parsed from the error log information, and the API interface of the code repository can be called to query the code snapshot of the corresponding version code. When querying using version control information, a cache acceleration strategy can be adopted, such as a cache acceleration strategy based on the Redis database, to avoid repeated queries of historical commitIds. For fuzzy paths, such as when the class name cannot uniquely locate the file path, a path push based on a Git index or code retrieval service can be used. The Git index is a binary file located at .git / index that acts as a buffer between the working directory and the repository, recording the current state of stored files (file names, permissions, hash values, etc.). A code snapshot is created with each code commit to the repository. A snapshot is a record of the state of a file or directory at a specific point in time. Each commit records a snapshot of all files in the current working directory, enabling efficient and reliable recording and retrieval of file history, thus providing strong version control capabilities. Using code location information (such as file path and line number) and code snapshots, you can quickly locate the target line of code and retrieve the commit information for that line. By embedding repository metadata in error logs and parsing them, you can automatically locate the target line of code across different versions of the repository, achieving automatic, accurate, and timely code location.
[0036] In some application examples, step S400, adding comment information to a line of code, includes: Generate comment information based on preset comment templates and error prompts, and add comment information to the code line.
[0037] Exemplarily, as described above, the error prompt information includes the error type, occurrence time, and error summary, or the error prompt information includes the error type, occurrence time, and key log fragments, or the error prompt information includes the error type, occurrence time, error summary, and key log fragments. According to actual application requirements, relevant content can be extracted from the error prompt information based on the comment template to generate comment information. For example, the comment information includes multiple of the error type, occurrence time, error summary, and key log fragments for maintenance personnel to review. In other application examples, the comment information also includes intelligent solutions, such as based on large models + RAG (retrieval enhanced generation) technology, integrating internal corporate coding standards, historical error cases, and technical documents across the entire network to generate targeted solution suggestions, thereby reducing the difficulty of code maintenance.
[0038] In some other application examples, step S400 of adding comment information to a line of code further includes at least one of the following: Generate a code hyperlink for the code line based on the preset code repository address and code location information, and add the code hyperlink to the comment information; Generate a version hyperlink of the target code based on the code repository address and version control information, and add the version hyperlink to the comment information; Get the log hyperlink of the error log information and add the log hyperlink to the comment information.
[0039] Exemplarily, a code hyperlink can be a combination of code repository address + file path + line number. By generating a code hyperlink and adding the code hyperlink to the comment information, maintenance personnel can click on the code hyperlink in the comment information to jump to the corresponding code line when viewing the comment information, thereby quickly locating the erroneous code line. Adding a version hyperlink in the comment information can associate the code line and the code version, making it easier to locate the corresponding code version; similarly, adding a log hyperlink in the comment information can jump to the corresponding error log details page by clicking on the log hyperlink, thereby improving the convenience of viewing the error log. In addition, adding a code hyperlink, a version hyperlink, and an error log hyperlink in the comment information at the same time can directly associate the code line, code version, and error log information, which is conducive to improving the integration of multiple types of information, ensuring that maintenance personnel can accurately receive scattered error log information, code version, and code line information, and reducing information errors caused by jumping between different information display interfaces.
[0040] In step S300, the submission information of the code line is obtained, including: Determine the code author of the target code based on version control information; Determine the project leader based on the project owner of the target code and the merger of the main branch; The code author and project leader are the code submission targets.
[0041] For example, during each code submission process, corresponding version control information, such as commitId, is generated and the corresponding submitter is recorded. Therefore, the submitter of the target code, that is, the code author, can be determined based on the version control information. In actual applications, there may be a long time between code submission and the occurrence of runtime errors. There may be various factors that prevent the code author from continuing to maintain the code as a maintainer. Therefore, it is necessary to determine the project leader based on the project owner of the target code and the merger of the main branch, and to make the code author and project leader the code submitters, so as to ensure that prompt information can be notified to the corresponding personnel in a timely manner.
[0042] Step S500, in response to the comment information adding operation, sends a prompt message to the code submission object, including: In response to an operation of adding comment information, obtaining the comment information and generating a prompt message according to the comment information; Call the preset notification service interface to send the prompt message to the code submission object.
[0043] For example, based on the WebHook function provided by the code repository, the comment event of the code line is monitored, and in response to the adding operation of the comment information, the comment information is obtained and a prompt message is generated according to the comment information. For example, an example of a prompt message is as follows: Figure 2 As shown, the prompt message includes error prompt information, such as error type and log time. The prompt message also includes version control information (such as Commit) and code location information, such as file location. The prompt message also includes log details, so that maintenance personnel can quickly view error information. The prompt message can also include navigation links, such as code hyperlinks at the file location, version hyperlinks at the commit location, and log hyperlinks at the log details location. By clicking the corresponding navigation link, you can quickly jump to the corresponding location, improving the convenience of code maintenance. The notification service supports multiple different platforms, such as enterprise WeChat, Feishu or DingTalk communication platforms. By calling the preset notification service interface, prompt messages can be sent to the code submission object, and it can also support multi-terminal push, such as supporting desktop, mobile and email terminals and other multi-channel notification methods.
[0044] In summary, this embodiment combines the real-time collection, analysis, comment addition and immediate alarm of error logs to ensure that operational problems of the target business system can be discovered in a timely manner, and the corresponding maintenance personnel can be notified, and the convenience of code maintenance for maintenance personnel can be improved. The version control information of the code is embedded in the error log information to achieve the correlation between the error log information and the code version. By parsing the error log information, the code of the corresponding version can be traced back, and the code line of the corresponding version code can be accurately located based on the code location information in the error log information, thereby achieving automatic, accurate and reliable positioning of the code. Adding comment information related to the error log information in the code line can facilitate maintenance personnel to view relevant error information during the code maintenance process, and there are multiple navigation links in the comment information. By clicking on the navigation link, different contents can be quickly jumped, which is conducive to improving the convenience of code maintenance and information viewing.
[0045] Please refer to Figure 3 , an embodiment of the present invention provides an error log monitoring device, comprising: Log acquisition module 110, used to obtain error log information of the target business system; The log parsing module 120 is used to parse the error log information and determine the target parsing information; The code locating module 130 is used to locate the code line of the target code according to the target parsing information and obtain the submission information of the code line, the submission information including the code submission object; A comment adding module 140 is used to add comment information to the code line, where the comment information includes part or all of the target parsed information; The message notification module 150 is configured to send a prompt message to the code submission object in response to the comment information adding operation, where the prompt message includes part or all of the comment information.
[0046] It should be noted that the inventive concept of the present error log supervision device is the same as the inventive concept of the above-mentioned error log supervision method embodiment. The contents not involved in the present error log supervision device embodiment can be referred to the above-mentioned error log supervision method embodiment and will not be repeated here. The present error log supervision device embodiment combines the real-time collection, analysis, comment addition and instant alarm of error logs to ensure that the operation problems of the target business system can be discovered in time, and the corresponding maintenance personnel are notified, and the convenience of the maintenance personnel in maintaining the code is improved. The version control information of the code is embedded in the error log information to achieve the mutual correlation between the error log information and the code version. By parsing the error log information, the code of the corresponding version can be traced back, and the code line of the corresponding version code can be accurately located according to the code location information in the error log information, thereby achieving automatic, accurate and reliable positioning of the code. Adding comment information related to the error log information in the code line can facilitate the maintenance personnel to view the relevant error information during the code maintenance process. In addition, there are multiple navigation links in the comment information, and the different content can be quickly jumped by clicking the navigation link, which is conducive to improving the convenience of code maintenance and information viewing.
[0047] Please refer to Figure 4 This embodiment also provides an error log monitoring system, including a processor 210 and a memory 220, wherein the memory 220 stores a computer program, and the processor 210 is used to implement the above-mentioned error log monitoring method when running the computer program. The details of the error log monitoring method can be found above and will not be repeated here. This embodiment can automatically locate the corresponding code line, add the parsed error log information to the comment, and can promptly notify the code submission object, which is conducive to improving the convenience of code maintenance.
[0048] Please refer to Figure 5 In some application examples, the error log monitoring system can be divided into a log system and an error log collection system. The log system is used to receive error log information uploaded by the target business system and transmit the error log information to the error log collection system. The error log collection system is used to parse the error log information and call the API interface of the code repository to locate the code line and add comment information to the corresponding code line. The code repository is used to provide code storage services of different versions, wherein the code repository is configured with a notification system. The notification system is used to monitor comment events of the code repository and send notification messages to the corresponding maintenance personnel in response to the addition of comment information. For example, the log system can use Alibaba Cloud's log service, the code repository uses the GitLab repository, and the notification system is based on the GitLab Hook function and integrates multiple communication platforms.
[0049] This embodiment also provides a storage medium storing a computer program that implements the above-mentioned error log monitoring method when the computer program is executed. The details of the error log monitoring method can be found above and will not be repeated here. This embodiment can automatically locate the corresponding line of code, add the parsed error log information to the comment, and promptly notify the code submitter, which is conducive to improving the convenience of code maintenance.
[0050] The embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the scope of the present invention.
Claims
1. A method for monitoring error logs, characterized in that: include: Obtain error log information of the target business system; Parsing the error log information to determine target parsing information; Locating a code line of the target code according to the target parsing information, and obtaining submission information of the code line, wherein the submission information includes a code submission object; Add comment information to the code line, wherein the comment information includes part or all of the target parsed information; In response to the adding operation of the comment information, a prompt message is sent to the code submission object, where the prompt message includes part or all of the comment information.
2. The error log monitoring method according to claim 1, characterized in that: The parsing of the error log information to determine target parsing information includes: Based on a preset regular expression or a structured log template, the error log information is parsed to obtain target parsing information, which includes version control information, code location information and error prompt information.
3. The error log monitoring method according to claim 2, characterized in that: The step of locating the target code line according to the target parsing information includes: Access the corresponding code repository according to the preset code repository address; According to the version control information, the API interface of the code repository is called to query the code snapshot of the corresponding version; According to the code location information and the code snapshot, the code line of the target code is located and the submission information of the code line is obtained.
4. The error log monitoring method according to claim 2 or 3, characterized in that: Adding comment information to the code line includes: Generate comment information based on a preset comment template and the error prompt information, and add the comment information to the code line.
5. The error log monitoring method according to claim 4, characterized in that: Adding comment information to the code line further includes at least one of the following: Generate a code hyperlink for the code line according to the preset code repository address and the code location information, and add the code hyperlink to the comment information; Generate a version hyperlink of the target code according to the code repository address and the version control information, and add the version hyperlink to the comment information; Obtain a log hyperlink of the error log information, and add the log hyperlink to the comment information.
6. The error log monitoring method according to any one of claims 2, 3 or 5, characterized in that: The obtaining of the submission information of the code line includes: Determining the code author of the target code according to the version control information; Determine the project leader based on the project owner of the target code and the merger of the main branch; The code author and the project leader are regarded as code submission objects.
7. The error log monitoring method according to claim 6, characterized in that: The sending of a prompt message to the code submission object in response to the adding operation of the comment information includes: In response to the adding operation of the comment information, obtaining the comment information and generating a prompt message according to the comment information; The preset notification service interface is called to send the prompt message to the code submission object.
8. An error log monitoring device, characterized in that: include: Log acquisition module, used to obtain error log information of the target business system; A log parsing module, configured to parse the error log information and determine target parsing information; A code locating module, configured to locate a code line of a target code according to the target parsing information, and obtain submission information of the code line, wherein the submission information includes a code submission object; A comment adding module, configured to add comment information to the code line, wherein the comment information includes part or all of the target parsed information; The message notification module is used to send a prompt message to the code submission object in response to the adding operation of the comment information, where the prompt message includes part or all of the comment information.
9. An error log monitoring system, comprising a processor and a memory, wherein the memory stores a computer program, characterized in that: When the processor runs the computer program, it is used to implement the error log supervision method according to any one of claims 1 to 7.
10. A storage medium storing a computer program, wherein: When the computer program is executed, the error log supervision method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Code review implementation method and device, storage medium, and electronic equipment
CN108089984A
Log analysis method and device, computer equipment and storage medium
CN113704192A
System exception positioning notification method and device, computer equipment and storage medium
CN119621549A
Systems and methods for managing data associated with computer code
US20070250810A1
Cited By
Intelligent diagnosis method and system for distributed system, electronic equipment and program product
CN122111782A