Log management method

By receiving log processing requests and generating a specified form of log processing content item, it adds it to the target class file of the Java executable program, the problem of strong coupling between business code and log processing code in the existing technology is solved, and the non-invasive log processing function is realized, reducing resource consumption.

CN113722217BActive Publication Date: 2025-06-13工银科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110966185.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-23
Publication Date
2025-06-13
Estimated Expiration
2041-08-23

AI Technical Summary

Technical Problem

The existing technology uses log and log code to write code to create strong coupling between business code and log code, which is highly invasive, affecting the efficiency of business system distribution and causing waste of resources.

Method used

Provides a log processing method. By receiving log processing requests, a specific form of log processing content items are generated, and added to the preset target class file of the Java executable program in the form of code snippets, obtain the enhanced processing class file, and then send it to the target application to realize the log processing operation.

Benefits of technology

It effectively reduces the coupling between logging code and business code, reduces the impact of logging code deployment and update on business code, reduces the consumption of business system development, testing, operation and maintenance resources, and realizes a non-invasive logging function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113722217B_ABST
    Figure CN113722217B_ABST
Patent Text Reader

Abstract

The present disclosure provides a log marking processing method, which is applied to the field of financial technology or other technical fields. The method includes: receiving a log marking request, where the log marking request indicates a marking operation for a target application based on at least one marking event to obtain marking log data associated with the target application; generating a log marking content item in a specified form associated with the marking operation according to the log marking request; adding the log marking content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced class file; and sending the enhanced class file to the target application so that the target application performs the marking operation based on the enhanced class file. The present disclosure also provides a log marking processing device, an electronic device, and a computer storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data processing, and in particular, to a method and apparatus for log marking processing, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Log marking is a data collection method that outputs customized information from a specified source address of a business project to a specified destination address. Log marking can be used to track the flow of business data, increase the controllability of data flow, and can be used to monitor the health status of a business project, or to make early predictions about key businesses.

[0003] In the process of implementing the technical solution of the present disclosure, the inventors found that in the related art, the log marking operation for a business project is implemented by writing log marking code in business code. This method has the problems of strong coupling between business code and log marking code, and strong invasiveness of the log marking function to the business system. Moreover, in the case of changes in log marking requirements, it is necessary to frequently deploy log marking code in the business system, which affects the release efficiency of the business system and causes waste of resources such as business system development, testing, and operation and maintenance. Summary of the Invention

[0004] One aspect of the present disclosure provides a log marking processing method for a marking control platform, including: receiving a log marking request, where the log marking request indicates a marking operation based on at least one marking event for a target application to obtain marking log data associated with the target application; generating a log marking content item in a specified form associated with the marking operation according to the log marking request; adding the log marking content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced processed class file; and sending the enhanced processed class file to the target application so that the target application performs the marking operation based on the enhanced processed class file.

[0005] Optionally, generating a log marking content item in a specified form associated with the marking operation according to the log marking request includes: determining method objects for triggering each of the marking events according to the at least one marking event indicated by the log marking request, and obtaining at least one method object associated with the log marking request; determining method attribute parameters associated with each method object, and generating a method call identifier for the corresponding method object based on the method attribute parameters; generating a log marking content item in a specified form associated with the corresponding method object according to the method call identifier for each method object, where the method attribute parameters include a method identifier parameter and a method call parameter, the method call parameter indicates the called path of the corresponding method object, and the specified form is a form of a content item that can be added to the target class file.

[0006] Optionally, the at least one method object associated with the log marking request is declared in the target class file; adding the log marking content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced class file includes: using each method object in the at least one method object as an object to be instrumented in the target class file, and inserting the log marking content item associated with each method object into the corresponding object to be instrumented in the form of a code snippet to obtain the enhanced class file.

[0007] Optionally, after obtaining the enhanced class file, it further includes: performing a function test on the enhanced class file to obtain a test result; and when the test result indicates that the test passes, performing an operation of sending the enhanced class file to the target application.

[0008] Optionally, sending the enhanced class file to the target application includes: sending the enhanced class file to the target application by means of the Hypertext Transfer Protocol or remote service invocation.

[0009] Another aspect of the present disclosure provides a log marking processing method for an application management platform, including: receiving an enhanced class file, where the enhanced class file is generated by a marking control platform based on a received log marking request, and the enhanced class file indicates at least one method object for triggering a marking event; determining an original class file in which the at least one method object is declared in an executable program; and replacing the original class file with the enhanced class file to obtain a class file with a log marking function.

[0010] Optionally, replacing the original class file with the enhanced class file to obtain a class file with logging function includes: constructing a corresponding class loader for the enhanced class file; using the class loader to load the enhanced class file into the executable program to replace the original class file in the executable program with the enhanced class file.

[0011] Optionally, the class loader is generated by inheriting the environment loader in the executable program; the method further includes: using the environment loader to load other class files on which the class file with logging function depends to trigger the logging event based on the at least one method object.

[0012] Optionally, the enhanced class file includes method call identifiers associated with each method object in the at least one method object, and the method call identifiers are generated based on the method attribute parameters of the corresponding method objects; the method further includes: constructing a logging listening event for each method object according to the method call identifiers associated with each method object; running the class file with logging function to capture the logging data generated during the invocation of each method object through the logging listening event to obtain the logging data for the logging request.

[0013] Optionally, the method further includes: capturing the call time information associated with each method object through the logging listening event; and determining the call frequency information and / or call duration information associated with the corresponding method object according to the call time information, where the call time includes the call start time and the call end time.

[0014] Optionally, the method further includes: uploading the logging data to a log processing platform based on a preset upload policy, so that the log processing platform performs at least one of the following processing operations: performing statistical processing on the logging data based on preset statistical items and statistical rules to obtain statistical results associated with the statistical items; performing monitoring processing on the running process of the target application based on preset monitoring metrics and the logging data; analyzing the running process of the target application based on the error information in the logging data to locate the cause of the running anomaly, where the upload policy includes real-time upload and / or delayed upload.

[0015] Optionally, after loading the enhanced class file into the executable program, it further includes: using the Java virtual machine tool interface proxy in the executable program to replace the original class file with the enhanced class file.

[0016] Another aspect of the present disclosure provides a dotting processing device for a dotting control platform, including: a first receiving module, configured to receive a log dotting request, where the log dotting request indicates a dotting operation based on at least one dotting event for a target application to obtain dotting log data associated with the target application; a first processing module, configured to generate a log dotting content item in a specified form associated with the dotting operation according to the log dotting request; a second processing module, configured to add the log dotting content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced class file; and a sending module, configured to send the enhanced class file to the target application so that the target application performs the dotting operation based on the enhanced class file.

[0017] Optionally, the first processing module includes: a first processing sub-module, configured to determine method objects for triggering each of the at least one dotting event according to the at least one dotting event indicated by the log dotting request to obtain at least one method object associated with the log dotting request; a second processing sub-module, configured to determine method attribute parameters associated with each of the method objects and generate a method call identifier for the corresponding method object based on the method attribute parameters; and a third processing sub-module, configured to generate a log dotting content item in a specified form associated with the corresponding method object according to the method call identifier for each of the method objects, where the method attribute parameters include a method identifier parameter and a method call parameter, the method call parameter indicates the called path of the corresponding method object, and the specified form is a form of a content item that can be added to the target class file.

[0018] Optionally, the at least one method object associated with the log dotting request is declared in the target class file; the second processing module includes: a fourth processing sub-module, configured to use each of the method objects in the at least one method object as a to-be-instrumented object in the target class file and insert the log dotting content item associated with each of the method objects into the corresponding to-be-instrumented object in the form of a code snippet to obtain the enhanced class file.

[0019] Optionally, the device further includes a fifth processing module, configured to perform a function test on the enhanced class file after the second processing module obtains the enhanced class file to obtain a test result; and perform an operation of sending the enhanced class file to the target application when the test result indicates that the test passes.

[0020] Optionally, the sending module includes: a fifth processing sub-module, configured to send the enhanced class file to the target application by means of the Hypertext Transfer Protocol or remote service invocation.

[0021] Another aspect of the present disclosure provides a dot processing device for an application management platform, including: a second receiving module, configured to receive the enhanced class file, where the enhanced class file is generated by a dot control platform based on a received log dotting request, and the enhanced class file indicates at least one method object for triggering a dotting event; a third processing module, configured to determine an original class file in an executable program that declares the at least one method object; and a fourth processing module, configured to replace the original class file with the enhanced class file to obtain a class file with a log dotting function.

[0022] Optionally, the fourth processing module includes: a sixth processing sub-module, configured to construct a corresponding class loader for the enhanced class file; a seventh processing sub-module, configured to use the class loader to load the enhanced class file into the executable program, so as to replace the original class file in the executable program with the enhanced class file.

[0023] Optionally, the class loader is generated by inheriting an environment loader in the executable program; the device further includes a sixth processing module, configured to use the environment loader to load other class files on which the class file with a log dotting function depends, so as to trigger the dotting event based on the at least one method object.

[0024] Optionally, the enhanced class file includes a method call identifier associated with each method object in the at least one method object, and the method call identifier is generated based on a method attribute parameter of the corresponding method object; the device further includes a seventh processing module, configured to construct a dotting listening event for each method object according to the method call identifier associated with each method object, and to run the class file with a log dotting function, so as to capture log data generated during the call of each method object through the dotting listening event, to obtain dotting log data for the log dotting request.

[0025] Optionally, the device further includes an eighth processing module, configured to capture call time information associated with each method object through the dotting listening event; and to determine call frequency information and / or call duration information associated with the corresponding method object according to the call time information, where the call time includes a call start time and a call end time.

[0026] Optionally, the device also includes a ninth processing module, which is used to upload the dotting log data to the log processing platform based on a preset upload strategy, so that the log processing platform performs at least one of the following processing operations: based on preset statistical items and statistical rules, statistical processing is performed on the dotting log data to obtain statistical results associated with the statistical items; based on preset monitoring indicators and the dotting log data, monitoring processing is performed on the running process of the target application; based on the error information in the dotting log data, the running process of the target application is analyzed to locate the cause of the abnormal operation, wherein the upload strategy includes real-time long transmission and / or delayed upload.

[0027] Optionally, the device also includes a tenth processing module, which is used to replace the original class file with the enhanced class file using the Java virtual machine tool interface agent in the executable program after the seventh processing submodule loads the enhanced class file into the executable program.

[0028] Another aspect of the present disclosure provides a log dotting implementation system, comprising: a dotting control platform of an embodiment of the present disclosure, and an application management platform of an embodiment of the present disclosure, wherein the dotting control platform is used to generate an enhanced class file according to a received log dotting request, and send the enhanced class file to the application management platform; the application management platform is used to generate a class file with a log dotting function according to the received enhanced class file, so as to implement log dotting based on the class file with the log dotting function and obtain dotting log data for the log dotting request.

[0029] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method of an embodiment of the present disclosure.

[0030] Another aspect of the present disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method of an embodiment of the present disclosure.

[0031] Another aspect of the present disclosure provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the method of the embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:

[0033] Figure 1Schematically shows the system architecture of a log marking processing method and apparatus according to an embodiment of the present disclosure;

[0034] Figure 2 Schematically shows a flowchart of a log marking processing method according to an embodiment of the present disclosure;

[0035] Figure 3 Schematically shows a flowchart of another log marking processing method according to an embodiment of the present disclosure;

[0036] Figure 4 Schematically shows a flowchart of yet another log marking processing method according to an embodiment of the present disclosure;

[0037] Figure 5 Schematically shows a flowchart of still another log marking processing method according to an embodiment of the present disclosure;

[0038] Figure 6 Schematically shows a schematic diagram of a log marking processing system according to an embodiment of the present disclosure;

[0039] Figure 7 Schematically shows a block diagram of a log marking processing apparatus according to an embodiment of the present disclosure;

[0040] Figure 8 Schematically shows a block diagram of another log marking processing apparatus according to an embodiment of the present disclosure;

[0041] Figure 9 Schematically shows a block diagram of a log marking implementation system according to an embodiment of the present disclosure;

[0042] Figure 10 Schematically shows a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners

[0043] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth in order to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is obvious that one or more embodiments can be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present disclosure.

[0044] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of features, operations, operations, and / or components, but do not exclude the presence or addition of one or more other features, operations, operations, or components.

[0045] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0046] In cases where expressions similar to "at least one of A, B, and C, etc." are used, generally, it should be interpreted according to the meaning commonly understood by those of ordinary skill in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0047] Some block diagrams and / or flowcharts are shown in the drawings. It should be understood that some of the blocks or combinations thereof in the block diagrams and / or flowcharts can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable logging processing devices, so that when executed by the processor, these instructions can create a device for implementing the functions / operations illustrated in these block diagrams and / or flowcharts. The technology of the present disclosure can be implemented in the form of hardware and / or software (including firmware, microcode, etc.). Additionally, the technology of the present disclosure can take the form of a computer program product on a computer-readable storage medium storing instructions, which can be used by or in conjunction with an instruction execution system.

[0048] Logging is a data collection method that outputs customized information from a specified source address of a business project to a specified destination address. Exemplarily, by deploying a logging framework such as log4j or logback at the code layer of a business project, the logged data can be output to a specified file or a logging processing platform. Logging can be used to track the flow of business data, increase the controllability of data flow, and can also be used to monitor the health status of a business project or make early predictions about critical businesses.

[0049] In the process of implementing the technical solution of the present disclosure, the inventors found that in the related art, the logging operation for a business project is implemented by writing logging code into the business code. This method has problems such as strong coupling between the business code and the logging code, and strong invasiveness of the logging function to the business system. In addition, the randomness of the logging code embedding method may cause chaos in the source code management of the business system.

[0050] In addition, the deployed logging code may not necessarily meet the logging requirements. In the case of changes in logging requirements, it is necessary to frequently deploy the logging code in the business system. At the same time, it is also necessary to frequently test code changes to ensure the normal functioning of the business system, which affects the release efficiency of the business system and causes waste of resources such as development, testing, and operation and maintenance of the business system.

[0051] In view of the problems in the related technology, such as strong coupling between business code and logging code, strong invasiveness of the logging function to the business system, frequent deployment of logging code affecting the release efficiency of the business system, and causing waste of testing and operation and maintenance resources of the business system, the embodiments of the present disclosure provide a logging processing method and device.

[0052] According to the logging processing method provided by the embodiments of the present disclosure, first, a logging request is received. The logging request indicates a logging operation based on at least one logging event for a target application to obtain logging data associated with the target application. Then, according to the logging request, a logging content item in a specified form associated with the logging operation is generated. Next, the logging content item is added to a preset target class file of the Java executable program in the form of a code snippet to obtain an enhanced class file. And, the enhanced class file is sent to the target application so that the target application performs the logging operation based on the enhanced class file.

[0053] Figure 1 Schematically shows the system architecture of the logging processing method and device according to the embodiments of the present disclosure. It should be noted that Figure 1 The shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0054] As Figure 1 shown, the system architecture 100 may include a user terminal 101, a logging control server 102, an application server 103, and a network 104. The network 104 is a medium for providing a communication link between the user terminal 101, the logging control server 102, and the application server 103. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc. The logging control server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud computing, network services, and middleware services.

[0055] The logging control server 102 receives a logging request from the user terminal 101. The logging request indicates a logging operation based on at least one logging event for a target application to obtain logging data associated with the target application. The logging control server 102 generates a logging content item in a specified form associated with the logging operation according to the logging request, and adds the logging content item to a preset target class file of the Java executable program in the form of a code snippet to obtain an enhanced class file. Further, the logging control server 102 sends the enhanced class file to the application server 103 so that the application server 103 performs the logging operation based on the enhanced class file.

[0056] It should be noted that the logging processing method and apparatus of the embodiments of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field. The present disclosure will be elaborated in detail below with reference to the drawings and specific embodiments.

[0057] Figure 2 A flowchart of a logging processing method according to an embodiment of the present disclosure is schematically shown, as Figure 2 shown, the method 200 may include operations S210 to S240.

[0058] In operation S210, a logging request is received. The logging request indicates a logging operation based on at least one logging event for a target application to obtain logging data associated with the target application.

[0059] Next, in operation S220, according to the logging request, a logging content item in a specified form associated with the logging operation is generated.

[0060] Next, in operation S230, the logging content item is added to a preset target class file of the Java executable program in the form of a code snippet to obtain an enhanced class file.

[0061] Next, in operation S240, the enhanced class file is sent to the target application so that the target application performs the logging operation based on the enhanced class file.

[0062] The following details the example processes of the steps of the logging processing method of this embodiment.

[0063] In operation S210, a logging request is received. The logging request indicates a logging operation based on at least one logging event for a target application to obtain logging data associated with the target application.

[0064] In an embodiment of the present disclosure, the method is applied to a logging control platform. The logging control server in the logging control platform receives a logging request from a client. The logging request indicates a logging operation for a target application based on at least one logging event. The target application may be an application for tracking the flow of business data, an application for monitoring the health status of a business project, or an application for screening the reasons for abnormal business operations. Depending on the different functions of the target application or the purpose of the logging operation, the logging events associated with the target application may be different. Exemplarily, the target application for which the logging operation is to be performed is the order system of an e-commerce platform, and the logging events associated with the order system include order placement events, order fulfillment events, payment events, etc.

[0065] Next, in operation S220, according to the logging request, a logging content item in a specified form associated with the logging operation is generated.

[0066] In an embodiment of the present disclosure, according to at least one logging event indicated by the logging request, method objects for triggering each logging event are determined, and at least one method object associated with the logging request is obtained. Method attribute parameters associated with each method object are determined, and a method call identifier for the corresponding method object is generated based on the method attribute parameters. According to the method call identifier for each method object, a logging content item in a specified form associated with the corresponding method object is generated. The method attribute parameters include a method identifier parameter and a method call parameter. The method call parameter indicates the called path of the corresponding method object, and the specified form is a form of a content item that can be added to the target class file.

[0067] According to different logging requirements, a preset logging template can be called to replace the placeholders in the logging template to generate a logging content item in a specified form associated with the logging request. In addition, the logging framework API (Application Programming Interface) can also be called to generate a logging content item in a specified form associated with the logging request by directly coding without relying on the logging template.

[0068] The method attribute parameters associated with the method object include a method identifier parameter and a method call parameter. The method identifier parameter is used to uniquely identify the method object. The method identifier parameter may include information such as the method object name, method object ID, method object signature, etc. The method call parameter indicates the called path of the corresponding method object, for example, indicating the source address information for generating the logging data and the output destination address information for the logging data. The method call identifier generated based on the method attribute parameters is used to determine whether the corresponding method object is called, and to determine information such as the total number of calls, call frequency, call duration, etc. when the method object is called.

[0069] Next, in operation S230, the log marking content item is added to the preset target class file of the Java executable program in the form of a code snippet to obtain an enhanced class file.

[0070] In the embodiment of the present disclosure, the Java executable program includes declaration codes of several classes. In the declaration code of each class, it includes definition information associated with the attributes of the class, and includes method declarations of the current class and method statements for calling other classes. At least one method object associated with the log marking request is declared in the target class file. When adding the log marking content item to the target class file, each method object in the at least one method object can be used as the object to be instrumented in the target class file, and the log marking content item associated with each method object is inserted into the corresponding object to be instrumented in the form of a code snippet to obtain an enhanced class file. Optionally, the log marking content item can be inserted into a specified position in the object to be instrumented, such as the adjacent front position or the adjacent rear position of the method object.

[0071] As a feasible method, after obtaining the enhanced class file, the enhanced class file can be placed in a test environment to perform a function test on the enhanced class file to obtain a test result. When the test result indicates that the test passes, the operation of sending the enhanced class file to the target application is executed.

[0072] Next, in operation S240, the enhanced class file is sent to the target application so that the target application performs a marking operation based on the enhanced class file.

[0073] In the embodiment of the present disclosure, the enhanced class file can be sent to the target application by means of the Hypertext Transfer Protocol or remote service call. Exemplarily, the enhanced class file can be transmitted to the target application by means of Http, RPC (Remote Procedure Call), etc.

[0074] Through the embodiments of the present disclosure, a log marking request is received. The log marking request indicates a marking operation for a target application based on at least one marking event to obtain marking log data associated with the target application; according to the log marking request, a log marking content item in a specified form associated with the marking operation is generated; the log marking content item is added to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced class file; and the enhanced class file is sent to the target application so that the target application performs a marking operation based on the enhanced class file. By generating a log marking content item in a specified form based on the log marking request and using the log marking content item for enhancing the target class file, a marking operation is implemented based on the enhanced class file. Compared with directly deploying log marking code at the business code layer of the target application, this design can effectively reduce the coupling between the log marking code and the business code, reduce the impact of the deployment and update operations of the log marking code on the business code, can effectively reduce the consumption of resources such as development, testing, and operation and maintenance of the business system, and is conducive to implementing a non-invasive log marking function.

[0075] Figure 3 Schematically shows a flowchart of another log marking processing method according to an embodiment of the present disclosure, as Figure 3 shown, the method 300 may include operations S310 to S330.

[0076] In operation S310, an enhanced class file is received. The enhanced class file is generated by a marking control platform based on the received log marking request. The enhanced class file indicates at least one method object for triggering a marking event.

[0077] Next, in operation S320, an original class file in which at least one method object is declared in the executable program is determined.

[0078] Next, in operation S330, the original class file is replaced with the enhanced class file to obtain a class file with a log marking function.

[0079] The following details the example processes of the steps of the log marking processing method of this embodiment.

[0080] In operation S310, an enhanced class file is received. The enhanced class file is generated by a marking control platform based on the received log marking request. The enhanced class file indicates at least one method object for triggering a marking event.

[0081] In an embodiment of the present disclosure, the method is applied to an application management platform. The application management platform receives the enhanced class file from the logging control platform. The enhanced class file is generated by the logging control platform based on the received logging request. The logging request indicates a logging operation for a target application based on at least one logging event to obtain logging data associated with the target application. The enhanced class file indicates at least one method object for triggering each logging event.

[0082] Next, in operation S320, determine the original class file in the executable program that declares at least one method object.

[0083] In an embodiment of the present disclosure, in the Java executable program, determine the original class file that declares at least one method object for triggering each logging event, and use the original class file as the class file to be replaced. Optionally, it is also possible to determine the class file with the same class file name as the enhanced class file in the Java executable program as the original class file to be replaced.

[0084] Next, in operation S330, use the enhanced class file to replace the original class file to obtain a class file with logging function.

[0085] In an embodiment of the present disclosure, construct a class loader for the enhanced class file, and use the class loader to load the enhanced class file into the executable program. Use the Java virtual machine tool interface proxy in the executable program to replace the original class file with the enhanced class file. Exemplarily, use the Agent in the Java process to replace the original class file with the enhanced class file. The Agent can be used as a medium for the Java virtual machine tool interface to interact with the outside world, and the Agent and the Java virtual machine can be executed in the same process.

[0086] The class loader is generated by inheriting the environment loader in the executable program. Optionally, after obtaining the class file with logging function, it is also possible to use the environment loader to load other class files on which the class file with logging function depends to trigger the logging event based on the foregoing at least one method object. In addition, it is also possible to use the environment loader to load the interfaces in the Java virtual machine so that the external environment can call the class file with logging function through the interfaces in the Java virtual machine.

[0087] Through the embodiments of the present disclosure, an enhanced class file is received. The enhanced class file is generated by a logging control platform based on the received logging request, and the enhanced class file indicates at least one method object for triggering a logging event. An original class file declaring at least one method object in the executable program is determined. The original class file is replaced with the enhanced class file to obtain a class file with a logging function. By replacing the original class file in the target application with the enhanced class file, the logging operation is implemented based on the enhanced class file. This design can effectively reduce the coupling between the logging code and the business code, facilitate the automated implementation of dynamic logging operations for the business system, basically eliminating the need to access the development, testing, and operation and maintenance resources of the business system, reducing the personnel investment and saving the logging operation cost. In addition, by quickly adding logging code, it is beneficial to implement an efficient and convenient non-invasive logging function.

[0088] Figure 4 Schematically shows a flowchart of another logging processing method according to an embodiment of the present disclosure, as Figure 4 shown, the method 400 may include operations S310 to S330, and operations S440 to S450.

[0089] For the detailed content of operations S310 to S330, please refer to the exemplary description in the foregoing embodiments and will not be elaborated here.

[0090] Next, in operation S440, a logging listening event for each method object is constructed according to the method call identifier associated with each method object.

[0091] Next, in operation S450, the class file with a logging function is run to implement capturing the logging data generated by each method object during the call process through the logging listening event, so as to obtain the logging data for the logging request.

[0092] The following details the example processes of the steps of the logging processing method of this embodiment.

[0093] In an embodiment of the present disclosure, according to the method call identifiers associated with each method object, a hit monitoring event is constructed for each method object. The types of hit monitoring events may include click monitoring events, swipe monitoring events, loading monitoring events, etc. Exemplarily, a certain method object is to trigger a web link in a specific page, and the type of hit monitoring event constructed based on the method object is a loading monitoring event. After the user triggers the web link in the specific page, the client sends a request to download the page file to the content distribution server. In response to the received request to download the page file, the content distribution server returns page file configuration information to the client so that the client can load the target page based on the page file configuration information. The hit monitoring event is used to capture the loading operation for the page file configuration information, thereby implementing the hit operation of the operation log for the web link of the specific page. The specific page may be, for example, an order placement page, and the web link in the specific page may be, for example, an order placement button in the order placement page.

[0094] As a feasible method, it is also possible to capture the call time information associated with each method object through the hit monitoring event, and based on the call time information, determine the call frequency information and / or call duration information associated with the corresponding method object, where the call time includes the call start time and the call end time. According to the call start time and call end time associated with the method object, the call duration information for the method object is determined. The call duration information of the method object indicates the method performance of the corresponding method object, and the method performance of the method object reflects the system performance of the business system. Therefore, it is possible to determine whether the system performance of the business system is normal based on the call duration information of the method object.

[0095] Optionally, after obtaining the hit log data, it is possible to perform compression processing on the hit log data based on a preset compression rule and compression ratio. As the requirements for hit operations vary, the preset compression rule can be customized based on different log data metrics. Different log data metrics may include, for example, log data type, log data generation time, method object response duration, and other contents.

[0096] Upload the hit log data to the log processing platform based on a preset upload policy, so that the log processing platform can perform at least one of the following processing operations: perform statistical processing on the hit log data based on a preset statistical item and statistical rule to obtain a statistical result associated with the statistical item; perform monitoring processing on the running process of the target application based on a preset monitoring metric and the hit log data; analyze the running process of the target application based on the error information in the hit log data to locate the cause of the running anomaly, where the upload policy includes real-time upload and / or delayed upload. Optionally, it is possible to directly perform online hits on the abnormal running process of the target application and upload the hit log data in real time.

[0097] Figure 5Schematically shown is a flowchart of another log marking processing method according to an embodiment of the present disclosure. As Figure 5 shown, the method 500 may include operations S510 to S550.

[0098] In operation S510, determine the log marking content.

[0099] Next, in operation S520, perform function enhancement on the target class file.

[0100] Next, in operation S530, transmit the enhanced class file to the target application system.

[0101] Next, in operation S540, use the enhanced class file to replace the original class file in the target application system.

[0102] Next, in operation S550, perform log marking.

[0103] In the embodiment of the present disclosure, according to the received log marking request, determine at least one marking event for the target application, and determine at least one method object for triggering each marking event, so as to determine the log marking content. Add the log marking content in the form of code snippets to the target class file to implement the function enhancement processing for the target class file. Transmit the enhanced class file to the target application system, so that the target application system uses the enhanced class file to replace the original class file to obtain a class file with log marking function, wherein at least one method object for triggering each marking event is declared in the original class file. The target application system triggers the log marking operation by running the class file with log marking function, thereby implementing non-intrusive log marking for the target application system.

[0104] Figure 6 Schematically shown is a schematic diagram of a log marking processing system according to an embodiment of the present disclosure.

[0105] As Figure 6 shown, the processing system 600 includes a marking control platform 601, a Java business system 602, and a log processing platform 603.

[0106] The logging control platform 601 includes a console and a dynamic logging engine. The console is used to determine the logging method and content according to the received logging request. The dynamic logging engine is used to enhance the functions of a preset target class file according to the determined logging method and content, so as to obtain an enhanced class file. The target application system in the Java business system 602 is used to receive the enhanced class file. The logging Agent in the target application system is used to replace the original class file with the enhanced class file to obtain a class file with logging function, so as to implement the logging operation based on the class file with logging function to obtain the logged log data. The log processing platform 603 is used to pull and consume the logged log data. Exemplarily, based on the pulled logged log data, monitoring services, log analysis services and other log consumption services are implemented.

[0107] Figure 7 Schematically shows a block diagram of a logging processing device according to an embodiment of the present disclosure.

[0108] As Figure 7 shown, the device 700 includes a first receiving module 701, a first processing module 702, a second processing module 703 and a sending module 704.

[0109] Among them, the first receiving module 701 is used to receive a logging request, and the logging request indicates to perform a logging operation based on at least one logging event for a target application to obtain logged log data associated with the target application. The first processing module 702 is used to generate a specified-form logging content item associated with the logging operation according to the logging request. The second processing module 703 is used to add the logging content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced class file. The sending module 704 is used to send the enhanced class file to the target application so that the target application performs a logging operation based on the enhanced class file.

[0110] Through the embodiments of the present disclosure, a log marking request is received. The log marking request indicates a marking operation for a target application based on at least one marking event to obtain marking log data associated with the target application. According to the log marking request, a log marking content item in a specified form associated with the marking operation is generated. The log marking content item is added to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced class file. And the enhanced class file is sent to the target application so that the target application performs a marking operation based on the enhanced class file. By generating a log marking content item in a specified form based on the log marking request and using the log marking content item for enhancing the target class file, a marking operation is implemented based on the enhanced class file. Compared with directly deploying log marking code in the business code layer of the target application, this design can effectively reduce the coupling between the log marking code and the business code, reduce the impact of the deployment and update operations of the log marking code on the business code, can effectively reduce the consumption of resources such as development, testing, and operation and maintenance of the business system, and is beneficial to realizing a non-invasive log marking function.

[0111] As a feasible way, the first processing module includes: a first processing sub-module, configured to determine method objects for triggering each marking event according to at least one marking event indicated by the log marking request, and obtain at least one method object associated with the log marking request; a second processing sub-module, configured to determine method attribute parameters associated with each method object and generate a method call identifier for the corresponding method object based on the method attribute parameters; a third processing sub-module, configured to generate a log marking content item in a specified form associated with the corresponding method object according to the method call identifier for each method object, where the method attribute parameters include a method identifier parameter and a method call parameter, and the method call parameter indicates the called path of the corresponding method object, and the specified form is a form of a content item that can be added to the target class file.

[0112] As a feasible way, at least one method object associated with the log marking request is declared in the target class file; the second processing module includes: a fourth processing sub-module, configured to use each method object in the at least one method object as an object to be instrumented in the target class file, and insert the log marking content item associated with each method object into the corresponding object to be instrumented in the form of a code snippet to obtain an enhanced class file.

[0113] As a feasible way, the apparatus further includes a fifth processing module, configured to perform a function test on the enhanced class file after the second processing module obtains the enhanced class file to obtain a test result; and perform an operation of sending the enhanced class file to the target application when the test result indicates that the test passes.

[0114] As a feasible way, the sending module includes: a fifth processing sub-module, configured to send the enhanced processed class file to the target application by means of the Hypertext Transfer Protocol or remote service invocation.

[0115] Figure 8 Schematically shows a block diagram of another log marking processing device according to an embodiment of the present disclosure.

[0116] As Figure 8 shown, the device 800 includes a second receiving module 801, a third processing module 802, and a fourth processing module 803.

[0117] Among them, the second receiving module 801 is configured to receive the enhanced processed class file, which is generated by the marking control platform based on the received log marking request, and the enhanced processed class file indicates at least one method object for triggering a marking event. The third processing module 802 is configured to determine the original class file in the executable program that declares at least one method object. And the fourth processing module 803 is configured to replace the original class file with the enhanced processed class file to obtain a class file with log marking function.

[0118] Through the embodiment of the present disclosure, receive the enhanced processed class file, which is generated by the marking control platform based on the received log marking request, and the enhanced processed class file indicates at least one method object for triggering a marking event; determine the original class file in the executable program that declares at least one method object; use the enhanced processed class file to replace the original class file to obtain a class file with log marking function. By replacing the original class file in the target application with the enhanced processed class file, the log marking operation is implemented based on the enhanced processed class file. This design can effectively reduce the coupling between the log marking code and the business code, is beneficial to the automatic implementation of the dynamic marking operation for the business system, can basically avoid accessing the development, testing, and operation and maintenance resources of the business system, is beneficial to reducing personnel investment and saving the marking operation cost. In addition, by quickly adding log marking code, it is beneficial to implement an efficient and convenient non-invasive log marking function.

[0119] As a feasible way, the fourth processing module includes: a sixth processing sub-module, configured to build a corresponding class loader for the enhanced processed class file; a seventh processing sub-module, configured to use the class loader to load the enhanced processed class file into the executable program to replace the original class file in the executable program with the enhanced processed class file.

[0120] As a feasible way, the class loader is generated by inheriting the environment loader in the executable program; the device further includes a sixth processing module, which is used to use the environment loader to load other class files on which the class file with the log marking function depends, so as to trigger a marking event based on at least one method object.

[0121] As a feasible way, the enhanced processed class file includes a method call identifier associated with each method object in at least one method object, and the method call identifier is generated based on the method attribute parameters of the corresponding method object; the device further includes a seventh processing module, which is used to construct a marking listening event for each method object according to the method call identifier associated with each method object, and to run the class file with the log marking function, so as to capture the log data generated during the calling process of each method object through the marking listening event, so as to obtain the marking log data for the log marking request.

[0122] As a feasible way, the device further includes an eighth processing module, which is used to capture the call time information associated with each method object through the marking listening event; and determine the call frequency information and / or call duration information associated with the corresponding method object according to the call time information, where the call time includes the call start time and the call end time.

[0123] As a feasible way, the device further includes a ninth processing module, which is used to upload the marking log data to the log processing platform based on a preset upload policy, so that the log processing platform performs at least one of the following processing operations: perform statistical processing on the marking log data based on preset statistical items and statistical rules to obtain statistical results associated with the statistical items; perform monitoring processing on the running process of the target application based on preset monitoring indicators and the marking log data; analyze the running process of the target application based on the error information in the marking log data to locate the cause of the running anomaly, where the upload policy includes real-time upload and / or lagged upload.

[0124] As a feasible way, the device further includes a tenth processing module, which is used to replace the original class file with the enhanced processed class file by using the Java virtual machine tool interface proxy in the executable program after the seventh processing sub-module loads the enhanced processed class file into the executable program.

[0125] It should be noted that in the embodiments of the present disclosure, the implementation manners of the device part are the same as or similar to those of the method part, and will not be described in detail here.

[0126] Any of a plurality of modules according to embodiments of the present disclosure, or at least part of the functions of any of them, may be implemented in one module. Any one or more of the modules according to embodiments of the present disclosure may be split into multiple modules for implementation. Any one or more of the modules according to embodiments of the present disclosure may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented by any other reasonable way of integrating or packaging circuits, in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, one or more of the modules according to embodiments of the present disclosure may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.

[0127] For example, any of the first receiving module 701, the first processing module 702, the second processing module 703, and the sending module 704, or any of the second receiving module 801, the third processing module 802, and the fourth processing module 803 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the first receiving module 701, the first processing module 702, the second processing module 703, and the sending module 704, or at least one of the second receiving module 801, the third processing module 802, and the fourth processing module 803 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented by any other reasonable way of integrating or packaging circuits, in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. At least one of the first receiving module 701, the first processing module 702, the second processing module 703, and the sending module 704, or at least one of the second receiving module 801, the third processing module 802, and the fourth processing module 803 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.

[0128] Figure 9 A block diagram of a log marking implementation system according to an embodiment of the present disclosure is schematically shown.

[0129] As Figure 9 shown, the implementation system 900 includes a marking control platform 901 and an application management platform 902.

[0130] Among them, the dotting control platform 901 is used to generate an enhanced processed class file according to the received log dotting request, and send the enhanced processed class file to the application management platform. The application management platform 902 is used to generate a class file with log dotting function according to the received enhanced processed class file, so as to implement log dotting based on the class file with log dotting function, and obtain dotting log data for the log dotting request.

[0131] Figure 10 A block diagram of an electronic device 1000 suitable for implementing the processing method and processing device according to an embodiment of the present disclosure is schematically shown. Figure 10 The illustrated electronic device 1000 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0132] As Figure 10 As shown, the electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage section 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), and so on. The processor 1001 may also include on-board memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0133] In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are stored. The processor 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. The processor 1001 performs various operations of the method flow according to an embodiment of the present disclosure by executing the programs in the ROM 1002 and / or the RAM 1003. It should be noted that the program may also be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 may also perform various operations of the method flow according to an embodiment of the present disclosure by executing the programs stored in one or more memories.

[0134] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, and the input / output (I / O) interface 1005 is also connected to the bus 1004. The electronic device 1000 may further include one or more of the following components connected to the I / O interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed so that a computer program read from it can be installed into the storage portion 1008 as needed.

[0135] According to an embodiment of the present disclosure, the method flow according to the embodiment of the present disclosure may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes program codes for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication portion 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, etc. may be implemented by computer program modules.

[0136] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0137] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include one or more memories other than the above-described ROM 1002 and / or RAM 1003 and / or ROM 1002 and RAM 1003.

[0138] An embodiment of the present disclosure further includes a computer program product, which includes a computer program. The computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method for detecting file upload vulnerabilities provided by the embodiment of the present disclosure.

[0139] When the computer program is executed by the processor 1001, the above functions defined in the system / apparatus of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described systems, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0140] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and be downloaded and installed through the communication part 1009, and / or be installed from the removable medium 1011. The program code contained in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0141] According to embodiments of the present disclosure, program code for executing the computer programs provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).

[0142] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0143] The above describes the embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes and not for limiting the scope of the present disclosure. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present disclosure.

Claims

1. A log marking processing method for a marking control platform, including: Receiving a log marking request, where the log marking request indicates a marking operation for a target application based on at least one marking event to obtain marking log data associated with the target application; Generating a log marking content item in a specified form associated with the marking operation according to the log marking request; Adding the log marking content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced processed class file; and Sending the enhanced processed class file to the target application so that the target application performs the marking operation based on the enhanced processed class file; wherein, generating a log marking content item in a specified form associated with the marking operation according to the log marking request includes: Determining method objects for triggering each of the marking events according to the at least one marking event indicated by the log marking request to obtain at least one method object associated with the log marking request; Determining method attribute parameters associated with each of the method objects and generating a method call identifier for the corresponding method object based on the method attribute parameters; Generating a log marking content item in a specified form associated with the corresponding method object according to the method call identifier for each of the method objects, wherein the method attribute parameters include a method identifier parameter and a method call parameter, the method call parameter indicates the called path of the corresponding method object, and the specified form is a form of a content item that can be added to the target class file.

2. The method according to claim 1, wherein, At least one of the method objects associated with the log marking request is declared in the target class file; The adding the log marking content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced processed class file includes: Regarding each method object in the at least one method object as a to-be-instrumented object in the target class file, and inserting the log marking content item associated with each method object into the corresponding to-be-instrumented object in the form of a code snippet to obtain the enhanced processed class file.

3. The method according to claim 1, wherein, After obtaining the enhanced processed class file, it further includes: Performing a function test on the enhanced processed class file to obtain a test result; When the test result indicates that the test passes, performing the operation of sending the enhanced processed class file to the target application.

4. The method according to any one of claims 1 to 3, wherein, The sending the enhanced processed class file to the target application includes: Sending the enhanced processed class file to the target application by means of the Hypertext Transfer Protocol or remote service invocation.

5. A log marking processing method for an application management platform, including: Receive the enhanced class file, which is generated by the dotting control platform based on the received log dotting request, and the enhanced class file indicates at least one method object for triggering a dotting event; Determine the original class file in the executable program that declares the at least one method object; Replace the original class file with the enhanced class file to obtain a class file with log dotting function; The enhanced class file includes a method call identifier associated with each method object in the at least one method object, and the method call identifier is generated based on the method attribute parameters of the corresponding method object; The method further includes: Construct a dotting listening event for each of the method objects according to the method call identifier associated with each of the method objects; Run the class file with the log dotting function to capture the log data generated by each of the method objects during the call through the dotting listening event, so as to obtain the dotting log data for the log dotting request.

6. The method according to claim 5, wherein, The replacing the original class file with the enhanced class file to obtain a class file with log dotting function includes: Construct a corresponding class loader for the enhanced class file; Use the class loader to load the enhanced class file into the executable program, so as to replace the original class file in the executable program with the enhanced class file.

7. The method according to claim 6, wherein, The class loader is generated by inheriting the environment loader in the executable program; The method further includes: Use the environment loader to load other class files on which the class file with the log dotting function depends, so as to trigger the dotting event based on the at least one method object.

8. The method according to claim 5, further includes: Capture the call time information associated with each of the method objects through the dotting listening event; and Determine the call frequency information and / or call duration information associated with the corresponding method object according to the call time information, wherein the call time includes a call start time and a call end time.

9. The method according to claim 5, further includes: Upload the dotting log data to the log processing platform based on a preset upload policy, so that the log processing platform performs at least one of the following processing operations: Perform statistical processing on the dotting log data based on preset statistical items and statistical rules to obtain a statistical result associated with the statistical item; Perform monitoring processing on the running process of the target application based on preset monitoring indicators and the dotting log data; Analyze the running process of the target application based on the error information in the dotting log data to locate the cause of the running anomaly, wherein the upload policy includes real-time upload and / or lagged upload.

10. The method according to claim 6, wherein, After loading the enhanced class file into the executable program, it further includes: Using the Java Virtual Machine Tool Interface proxy in the executable program, replace the original class file with the enhanced processed class file.

11. A dotting processing device for a dotting control platform comprises: A first receiving module, configured to receive a log dotting request, where the log dotting request indicates a dotting operation for a target application based on at least one dotting event to obtain dotting log data associated with the target application; A first processing module, configured to generate a log dotting content item in a specified form associated with the dotting operation according to the log dotting request; A second processing module, configured to add the log dotting content item to a preset target class file of a Java executable program in the form of a code snippet to obtain an enhanced processed class file; and A sending module, configured to send the enhanced processed class file to the target application, so that the target application performs the dotting operation based on the enhanced processed class file; The first processing module includes: a first processing sub-module, configured to determine method objects for triggering each of the dotting events according to the at least one dotting event indicated by the log dotting request to obtain at least one method object associated with the log dotting request; a second processing sub-module, configured to determine method attribute parameters associated with each of the method objects and generate a method call identifier for the corresponding method object based on the method attribute parameters; a third processing sub-module, configured to generate a log dotting content item in a specified form associated with the corresponding method object according to the method call identifier for each of the method objects, where the method attribute parameters include a method identifier parameter and a method call parameter, the method call parameter indicates the called path of the corresponding method object, and the specified form is a form of a content item that can be added to the target class file.

12. A dotting processing device for an application management platform comprises: A second receiving module, configured to receive an enhanced processed class file, where the enhanced processed class file is generated by a dotting control platform based on a received log dotting request, and the enhanced processed class file indicates at least one method object for triggering a dotting event; A third processing module, configured to determine an original class file in an executable program that declares the at least one method object; and A fourth processing module, configured to replace the original class file with the enhanced processed class file to obtain a class file with a log dotting function; The enhanced processed class file includes a method call identifier associated with each of the at least one method objects, and the method call identifier is generated based on the method attribute parameters of the corresponding method object; the device further includes a seventh processing module, configured to construct a dotting listening event for each of the method objects according to the method call identifier associated with each of the method objects, and to run the class file with the log dotting function to implement capturing log data generated during the calling process of each of the method objects through the dotting listening event to obtain dotting log data for the log dotting request.

13. A log marking implementation system, comprising: the marking control platform described in claim 11, and the application management platform described in claim 12, wherein, the marking control platform is configured to generate an enhanced processed class file according to the received log marking request, and send the enhanced processed class file to the application management platform; the application management platform is configured to generate a class file with log marking function according to the received enhanced processed class file, so as to implement log marking based on the class file with log marking function, and obtain marking log data for the log marking request.

14. An electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of claims 1 to 4, or implement the method described in any one of claims 5 to 10.

15. A computer-readable storage medium, on which executable instructions are stored, and when the instructions are executed by a processor, the processor implements the method described in any one of claims 1 to 4, or implements the method described in any one of claims 5 to 10.

16. A computer program product, comprising a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 4 is implemented, or the method described in any one of claims 5 to 10 is implemented.

Citation Information

Patent Citations

  • Log processing method, system and device and storage medium

    CN111339051A

  • Log processing method and device of micro-service module, storage medium and electronic device

    CN113010378A