Log printing method and system, electronic equipment and storage medium

The log plug-in generates and applies log printing configuration information, and uses Spring Aop to intercept the target code method to realize dynamic printing of logs in business services, solves the problems of cumbersome log printing and inability to locate in time in the existing technology, and improves log printing Convenience and problem-solving efficiency.

CN119105933APending Publication Date: 2024-12-10SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411221557.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

In the operation and maintenance of business services, the log printing process is complicated and log positioning cannot be increased in time, resulting in increased difficulty in solving problems.

Method used

Generate log printing configuration information through the log plug-in, including the path information of the object code method and the log attribute configuration information. Use Spring Aop to generate proxy objects, intercept the information of the object code method for log printing, realize dynamic log output, and avoid recompilation and deployment.

Benefits of technology

It realizes the convenience and timeliness of log printing, can quickly deal with sudden problems in the production environment, simplifies the log positioning process, and improves the efficiency of problem solving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105933A_ABST
    Figure CN119105933A_ABST
Patent Text Reader

Abstract

The invention discloses a log printing method and system, electronic equipment and a storage medium, and the log printing method comprises the steps: responding to a log printing configuration adding operation of a user through a log plug-in, and generating log printing configuration information; wherein the log printing configuration information comprises path information of a target code method and log attribute configuration information; starting the log printing configuration information; when the target code method is called each time, printing a log according to the log attribute configuration information in the log printing configuration information based on path information of the target code method in the log printing configuration information to obtain a current target log; and outputting the current target log.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of business service operation and maintenance technology, and in particular to a log printing method and system, electronic equipment, and storage medium. Background Art

[0002] Currently, in the operation and maintenance process of business service applications, especially when an exception occurs, in order to facilitate the location of the problem, the communication needs to print logs for the key locations of the code method according to needs, that is, print out the execution information at the key locations of the code method.

[0003] Currently, the printing of business logs is mainly done by program developers through logback and other log frameworks. In the code method that needs to be printed, the corresponding printing code implementation is manually added according to the needs. In the process of executing the code that needs to be printed, the printing code implementation will be executed, thereby realizing the printing of the information of the code that needs to be printed, that is, realizing the log printing of the code method.

[0004] However, this implementation method requires the development of recompilation and deployment of services, which is not only cumbersome, but also cannot promptly increase log positioning for sudden problems in the production environment, making it impossible to print corresponding logs in time, increasing the difficulty of problem solving. Summary of the invention

[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a log printing method and system, an electronic device, and a storage medium to solve the problem that the prior art is relatively cumbersome and cannot increase log positioning in a timely manner.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The first aspect of the present application provides a log printing method, comprising:

[0008] In response to the user's log printing configuration adding operation through the log plug-in, log printing configuration information is generated; wherein the log printing configuration information includes the path information of the target code method and the log attribute configuration information;

[0009] Enable the log printing configuration information;

[0010] Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information to obtain the current target log;

[0011] Output the current target log.

[0012] Optionally, in the above-mentioned log printing method, before generating the log printing configuration information in response to the log printing configuration adding operation of the user through the log plug-in, the method further includes:

[0013] After the business service is started, the information of the log plug-in is registered to the log management background.

[0014] Optionally, in the above-mentioned log printing method, enabling the log printing configuration information includes:

[0015] Uploading the log printing configuration information to the configuration management service of the configuration management center through the log management background;

[0016] Generate proxy objects using Spring Aop through the log plug-in;

[0017] The log printing configuration information in the configuration management service of the management center is matched through the proxy object.

[0018] Optionally, in the above-mentioned log printing method, whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information to obtain the current target log, including:

[0019] Whenever the target code method is called, the proxy object intercepts the information of the target code method based on the path information of the target code method in the matching log printing configuration information;

[0020] According to the log attribute configuration information in the log printing configuration information, the information of the intercepted target code method is log printed to obtain the current target log.

[0021] Optionally, in the above-mentioned log printing method, whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information, including:

[0022] Whenever the target code method is called, each subdirectory under the log directory in the log printing configuration information is determined;

[0023] For each of the subdirectories under the log directory in the log printing configuration information, except for the exclusion directory in the log printing configuration information, log printing is performed on the code method of the subdirectory according to the configuration items of each printing information in the log printing configuration information to obtain the printing log corresponding to each of the subdirectories;

[0024] The print logs corresponding to each subdirectory are combined into the current target log.

[0025] A second aspect of the present application provides a log printing system, comprising:

[0026] A configuration unit, configured to generate log printing configuration information in response to a log printing configuration adding operation by a user through a log plug-in; wherein the log printing configuration information includes path information of a target code method and log attribute configuration information;

[0027] An enabling unit, used for enabling the log printing configuration information;

[0028] a printing unit, configured to print a log according to the log attribute configuration information in the log printing configuration information based on the path information of the target code method in the log printing configuration information whenever the target code method is called, so as to obtain a current target log;

[0029] An output unit is used to output the current target log.

[0030] Optionally, in the above log printing system, it also includes:

[0031] The registration unit is used to register the information of the log plug-in to the log management background after the business service is started.

[0032] Optionally, in the above-mentioned log printing system, the enabling unit includes:

[0033] An uploading unit, used to upload the log printing configuration information to the configuration management service of the configuration management center through the log management background;

[0034] The generation unit is used to generate proxy objects using SpringAop through the log plug-in;

[0035] A matching unit is used to match the log printing configuration information in the configuration management service of the management center through the proxy object.

[0036] Optionally, in the above-mentioned log printing system, the printing unit includes:

[0037] The first printing unit is used to intercept the information of the target code method through the proxy object based on the path information of the target code method in the matching log printing configuration information whenever the target code method is called, and to log print the intercepted information of the target code method according to the log attribute configuration information in the log printing configuration information to obtain the current target log.

[0038] Optionally, in the above-mentioned log printing system, the printing unit includes:

[0039] A determination unit, configured to determine each subdirectory under the log directory in the log printing configuration information whenever the target code method is called;

[0040] A second printing unit is used for printing logs for each of the subdirectories under the log directory in the log printing configuration information, except for the exclusion directory in the log printing configuration information, according to the configuration items of each printing information in the log printing configuration information, to obtain the printing logs corresponding to each of the subdirectories;

[0041] The combining unit is used to combine the print logs corresponding to the various sub-directories into the current target log.

[0042] A third aspect of the present application provides an electronic device, including:

[0043] Memory and processor;

[0044] Wherein, the memory is used to store programs;

[0045] The processor is used to execute the program. When the program is executed, it is specifically used to implement any of the log printing methods described above.

[0046] A fourth aspect of the present application provides a computer storage medium for storing a computer program, wherein when the computer program is executed by a processor, the computer program is used to implement the log printing method as described in any one of the above.

[0047] The embodiment of the present application provides a log printing method. When it is necessary to add a log location, the log printing configuration adding operation of the user through the log plug-in is responded to, and the log printing configuration information is generated. Wherein, the log printing configuration information includes the path information of the target code method and the log attribute configuration information, so that the introduced log plug-in provides the function of printing the path and attributes and other related information of the configuration code method. When log printing is needed, the log printing configuration information is enabled. Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information, the current target log is obtained, and the current target log is output, thereby realizing a method for printing logs according to demand based on the log printing configuration information, making log printing more convenient, and adding corresponding log printing configuration information. The corresponding log location can be added without recompiling and deploying services, which can effectively deal with sudden problems in the production environment and better assist in problem solving. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0049] Figure 1 A flow chart of a log printing method provided in an embodiment of the present application;

[0050] Figure 2 A flowchart of a method for enabling log printing configuration information provided by an embodiment of the present application;

[0051] Figure 3 A flowchart of a method for printing logs based on log printing configuration information provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of an architecture for implementing log printing provided in an embodiment of the present application;

[0053] Figure 5 A flowchart of another method for printing logs based on log printing configuration information provided in an embodiment of the present application;

[0054] Figure 6 A schematic diagram of a configuration interface provided in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of the architecture of a log printing system provided in an embodiment of the present application;

[0056] Figure 8 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0058] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0059] The present application embodiment provides a log printing method, such as Figure 1 As shown, the specific steps include:

[0060] S101, in response to a user's log printing configuration adding operation through a log plug-in, generating log printing configuration information.

[0061] Among them, the log printing configuration information includes the path information of the target code method and the log attribute configuration information. Among them, the target code method is the code method that needs to print the log. The path information of the target code method can specifically be the directory information corresponding to the target code method, which is mainly to determine where the log of the target code method can be printed. The log attribute configuration information is the content and format of the specific log to be printed, so its main function is to specify the specific printed log to meet the corresponding needs. It can specifically include information such as log type, structure, exception handling, etc.

[0062] It should be noted that in order to make the implementation of log printing more convenient and to be able to quickly respond to sudden problems in the production environment and to increase log positioning in a timely manner, in an embodiment of the present application, log printing is achieved by configuring information according to log printing requirements.

[0063] In order to realize log printing by configuring log printing information and log printing configuration information, a corresponding log framework is provided in the embodiment of the present application. In order to add the log framework to the existing business service without making unnecessary code changes, so as to log the code method in the business service through the log framework, in the embodiment of the present application, the log framework that implements the method provided by the embodiment of the present application is introduced into the business service by means of a plug-in, for example, it can be introduced in the form of a Jar package using Maven in a Java project.

[0064] Therefore, when it is necessary to increase the log printing of the target code method, the user can add the log printing configuration through the log plug-in. Specifically, the business service can call the log plug-in to provide a corresponding configuration interface, and the user can add the log printing configuration according to the needs. At this time, it will respond to the user's addition operation and generate a log printing configuration information.

[0065] Optionally, in order to facilitate the management of the log plug-in and the use of the log plug-in to configure and manage log printing information, in another embodiment of the present application, before executing step S101, it is necessary to further execute:

[0066] After the business service is started, the log plug-in information is registered to the log management background.

[0067] Optionally, the information of the log plug-in can be registered to the Apollo configuration center of the log management background, so that the configuration center can centrally manage which services use the log plug-in. After the registration is completed, the log plug-in can be used through the log management background to add, modify and delete the log management background.

[0068] S102, enabling log printing configuration information.

[0069] It should be noted that, since the previous step is a configuration operation, only the log printing configuration information is obtained. In order for the log printing configuration information to take effect during the operation of the implemented business service, it is necessary to enable it to apply the log printing configuration information to the corresponding implementation logic.

[0070] Furthermore, since there may be multiple log printing configuration information, in order to facilitate use or disable according to demand, the use of each log printing configuration information can be realized by whether to enable the log printing configuration information. Therefore, optionally, the log printing configuration information can be enabled in the operation interface, such as clicking the "enable" case, thereby enabling the log printing configuration information and introducing it into the specific implementation logic.

[0071] Therefore, correspondingly, for the previously configured log printing configuration information, when log printing is required, there is no need to execute step S101 again, and it only needs to be enabled through step S102.

[0072] Optionally, in another embodiment of the present application, a specific implementation of step S102 is as follows: Figure 2 As shown, the following steps are included:

[0073] S201. Upload log printing configuration information to the configuration management service of the configuration management center through the log management background.

[0074] It should be noted that, due to the traditional way of writing configuration information in the configuration file, when the configuration information needs to be modified, it is necessary to redeploy the published application to achieve, and this obviously cannot meet the sudden problems of the application production environment, that is, it is impossible to increase the log location in time, so this method cannot be adopted. And the way of storing the configuration information in the table of the database, and then reading the configuration information in the table by the program, although it can also realize dynamic reading of the configuration information, it lacks authority control, does not have the problem of statistical configuration in the management interface, and is not easy to manage and configure. So in the embodiment of the present application, the log printing configuration information will be uploaded to the configuration management service of the configuration management center by the log management background, so that the log printing configuration information can be directly read by the configuration management center, applied to the realization logic of log printing, and also easy to manage.

[0075] Optionally, the configuration management center may specifically be Apollo, and thus the log printing configuration information may specifically be uploaded to Apollo Config through the log management backend.

[0076] S202. Generate a proxy object using SpringAop through a log plug-in.

[0077] It should be noted that, in order to realize log printing according to log printing configuration information, it is necessary to increase the implementation logic of log printing according to log printing configuration information accordingly. Spring Aop is a technology for realizing proxy addition, which can execute some additional functional logic through the added proxy object on the basis of the original method, and can realize the enhancement of the original function in a non-invasive way. Therefore, in the embodiment of the present application, the implementation logic of log printing according to log printing configuration information is added to the original method technology through Spring Aop, so that the log printing function can also be increased in a non-invasive way. Therefore, it is necessary to generate a proxy object using Spring Aop through a log plug-in.

[0078] S203: Print configuration information in the log of the configuration management service of the management center through the proxy object matching.

[0079] In order to enable the proxy object to print based on the enabled log printing configuration information when implementing log printing, the proxy object is also required to match the enabled log printing configuration information, so as to finally implement the log printing configuration information, which can be used to print logs and output logs.

[0080] S103. Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information to obtain the current target log.

[0081] Specifically, whenever the target code method is called, that is, when the target code method is executed, the introduced log plug-in will obtain the corresponding information based on the path information of the target code method in the log printing configuration information, and extract the required data according to the log attribute configuration information in the log printing configuration information, and print out the current target log according to the configured format.

[0082] Optionally, in another embodiment of the present application, the current step S102 adopts the following Figure 2 When the implementation shown in the embodiment is implemented, accordingly, a specific implementation of step S103 is as follows: Figure 3 As shown, including:

[0083] S301. Whenever a target code method is called, information of the target code method is intercepted through a proxy object based on path information of the target code method in matching log printing configuration information.

[0084] S302: Print the information of the intercepted target code method in the log attribute configuration information according to the log printing configuration information to obtain the current target log.

[0085] Specifically, an insertion chain may be added to the original method object where the proxy occurs, that is, the target code method object, and the added log printing logic may be implemented through the insertion chain, thereby realizing the log printing proxy.

[0086] Therefore, optionally, in the embodiment of the present application, the process of implementing log printing can be as follows: Figure 4 As shown in the figure, the log management backend pushes the log configuration to Apollo Config. The proxy object matches the rules and uses the insertion chain in the original method object in the aspect to print the log during the execution of the target code method, thereby realizing the proxy and finally outputting the log.

[0087] Optionally, in another embodiment of the present application, another specific implementation of step S103 is as follows: Figure 5 As shown, the following steps are included:

[0088] S501. Whenever a target code method is called, each subdirectory under the log directory in the log printing configuration information is determined.

[0089] S502. For each subdirectory under the log directory in the log printing configuration information, except for the exclusion directory in the log printing configuration information, log printing is performed on the code method of the subdirectory according to the configuration items of each printing information in the log printing configuration information to obtain the printing log corresponding to each subdirectory.

[0090] It should be noted that, in the embodiment of the present application, the path information of the target code method is the directory corresponding to the target code method, and specifically includes the main directory of the target code method and the subdirectories under the main directory that need to be excluded, so that only the information under some subdirectories can be printed to meet different log printing needs.

[0091] The log attribute configuration information applied to printing is mainly the configuration information of various printing information, such as Figure 6 In the configuration interface of log printing configuration information shown, the log directory is the main directory of the target code method, and multiple excluded subdirectories can be configured in the excluded directory according to needs. Print parameters, print results, and print exception stack are configuration items for various printing information. When they are turned on, it means that the information needs to be printed.

[0092] S503: The print logs corresponding to the sub-directories are combined into a current target log.

[0093] In order to output the print logs corresponding to each subdirectory as a whole, the print logs corresponding to each subdirectory are combined into the current target log.

[0094] S104: Output the current target log.

[0095] Optionally, the current target log may be output to a default address, or may be output to a configured address according to configuration information.

[0096] The embodiment of the present application provides a log printing method. When it is necessary to add a log location, the log printing configuration adding operation of the user through the log plug-in is responded to, and the log printing configuration information is generated. Wherein, the log printing configuration information includes the path information of the target code method and the log attribute configuration information, so that the introduced log plug-in provides the function of printing the path and attributes and other related information of the configuration code method. When log printing is needed, the log printing configuration information is enabled. Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information, the current target log is obtained, and the current target log is output, thereby realizing a method for printing logs according to demand based on the log printing configuration information, making log printing more convenient, and adding corresponding log printing configuration information. The corresponding log location can be added without recompiling and deploying services, which can effectively deal with sudden problems in the production environment and better assist in problem solving.

[0097] Another embodiment of the present application provides a log printing system, such as Figure 7 As shown, including:

[0098] The configuration unit 701 is used to generate log printing configuration information in response to a log printing configuration adding operation performed by a user through a log plug-in.

[0099] The log printing configuration information includes the path information of the target code method and the log attribute configuration information.

[0100] The enabling unit 702 is used to enable log printing configuration information.

[0101] The printing unit 703 is used to print the log according to the log attribute configuration information in the log printing configuration information based on the path information of the target code method in the log printing configuration information whenever the target code method is called, so as to obtain the current target log.

[0102] The output unit 704 is used to output the current target log.

[0103] Optionally, in another embodiment of the present application, the log printing system further includes:

[0104] The registration unit is used to register the log plug-in information to the log management background after the business service is started.

[0105] Optionally, in a log printing system provided in another embodiment of the present application, the enabling unit includes:

[0106] The uploading unit is used to upload the log printing configuration information to the configuration management service of the configuration management center through the log management background.

[0107] The generation unit is used to generate proxy objects using SpringAop through the log plug-in.

[0108] The matching unit is used to match the log printing configuration information in the configuration management service of the management center through the proxy object.

[0109] Optionally, in a log printing system provided in another embodiment of the present application, the printing unit includes:

[0110] The first printing unit is used to intercept the information of the target code method through the proxy object based on the path information of the target code method in the matching log printing configuration information whenever the target code method is called, and to log print the intercepted target code method information according to the log attribute configuration information in the log printing configuration information to obtain the current target log.

[0111] Optionally, in a log printing system provided in another embodiment of the present application, the printing unit includes:

[0112] The determination unit is used to determine each subdirectory under the log directory in the log printing configuration information whenever the target code method is called.

[0113] The second printing unit is used to print logs for the code methods of the subdirectories under the log directory in the log printing configuration information, except for the excluded directories in the log printing configuration information, according to the configuration items of each printing information in the log printing configuration information, so as to obtain the printing logs corresponding to each subdirectory.

[0114] The combination unit is used to combine the print logs corresponding to each subdirectory into the current target log.

[0115] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the implementation process of the corresponding steps provided in the above method embodiments, and will not be repeated here.

[0116] Another embodiment of the present application provides an electronic device, such as Figure 8 As shown, including:

[0117] Memory 801 and processor 802 .

[0118] The memory 801 is used to store programs.

[0119] The processor 802 is used to execute the program stored in the memory 801. When the program is executed, it is specifically used to implement the log printing method provided in any one of the above embodiments.

[0120] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed by a processor, it is used to implement the log printing method provided in any of the above embodiments.

[0121] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0122] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0123] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A log printing method, It is characterized in that include: In response to the user's log printing configuration adding operation through the log plug-in, log printing configuration information is generated; wherein the log printing configuration information includes the path information of the target code method and the log attribute configuration information; Enable the log printing configuration information; Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information to obtain the current target log; Output the current target log.

2. The method according to claim 1, It is characterized in that The step of responding to the user's log printing configuration adding operation through the log plug-in and generating the log printing configuration information further includes: After the business service is started, the information of the log plug-in is registered to the log management background.

3. The method according to claim 2, It is characterized in that The enabling of the log printing configuration information includes: Uploading the log printing configuration information to the configuration management service of the configuration management center through the log management background; Generate proxy objects using SpringAop through the log plug-in; The log printing configuration information in the configuration management service of the management center is matched through the proxy object.

4. The method according to claim 3, It is characterized in that Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, the log is printed according to the log attribute configuration information in the log printing configuration information to obtain the current target log, including: Whenever the target code method is called, the proxy object intercepts the information of the target code method based on the path information of the target code method in the matching log printing configuration information; According to the log attribute configuration information in the log printing configuration information, the information of the intercepted target code method is log printed to obtain the current target log.

5. The method according to claim 1, It is characterized in that Whenever the target code method is called, based on the path information of the target code method in the log printing configuration information, printing the log according to the log attribute configuration information in the log printing configuration information includes: Whenever the target code method is called, each subdirectory under the log directory in the log printing configuration information is determined; For each of the subdirectories under the log directory in the log printing configuration information, except for the exclusion directory in the log printing configuration information, log printing is performed on the code method of the subdirectory according to the configuration items of each printing information in the log printing configuration information to obtain the printing log corresponding to each of the subdirectories; The print logs corresponding to each subdirectory are combined into the current target log.

6. A log printing system, It is characterized in that include: A configuration unit, configured to generate log printing configuration information in response to a log printing configuration adding operation by a user through a log plug-in; wherein the log printing configuration information includes path information of a target code method and log attribute configuration information; An enabling unit, used for enabling the log printing configuration information; a printing unit, configured to print a log according to the log attribute configuration information in the log printing configuration information based on the path information of the target code method in the log printing configuration information whenever the target code method is called, so as to obtain a current target log; An output unit is used to output the current target log.

7. The system according to claim 6, It is characterized in that Also includes: The registration unit is used to register the information of the log plug-in to the log management background after the business service is started.

8. The system according to claim 7, It is characterized in that The enabling unit comprises: An uploading unit, used to upload the log printing configuration information to the configuration management service of the configuration management center through the log management background; The generation unit is used to generate proxy objects using SpringAop through the log plug-in; A matching unit is used to match the log printing configuration information in the configuration management service of the management center through the proxy object.

9. An electronic device, It is characterized in that include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the log printing method according to any one of claims 1 to 5.

10. A computer storage medium, It is characterized in that Used to store a computer program, which, when executed by a processor, is used to implement the log printing method according to any one of claims 1 to 5.