A business log processing method, apparatus and system

CN116800595BActive Publication Date: 2026-08-14JINGDONG TECH HLDG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]相关技术中针对业务日志级别调整的开关逻辑设置在相应的业务系统中,难以实现针对业务日志级别调整的统一管理和维护,导致业务日志处理效率低下;同时,当面临业务不可中断且业务日志数量暴增的情形时,难以快速实现业务日志级别的线上调整,导致业务系统的服务性能下降,业务系统的稳定性和时效性较低,用户体验较差

Benefits of technology

[0038]上述发明中的一个实施例具有如下优点或有益效果:因为采用响应于业务应用接入请求,配置业务应用对应的业务日志级别调整的开关配置信息,其中,开关配置信息指示了业务日志对应的开关状态和当前业务日志级别;将开关配置信息发送至业务应用对应的客户端,以使得,客户端根据开关配置信息确定业务应用对应的日志输出策略的技术手段,所以克服了相关技术中由于针对业务日志级别调整的开关逻辑设置在相应的业务系统中,导致难以实现针对业务日志级别调整的统一管理和维护,业务日志处理效率低下,业务系统的服务性能下降,用户体验较差的技术问题,进而达到能够通过管理端控制业务日志级别调整的开关逻辑,实现了对业务日志级别调整的统一管理和维护,提高了业务日志处理效率;同时结合所配置的业务日志监控指标实现对业务日志级别的线上快速调整,有效保障了业务系统的稳定性和时效性,提升了用户体验的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116800595B_ABST
    Figure CN116800595B_ABST
Patent Text Reader

Abstract

This invention discloses a business log processing method, apparatus, and system, relating to the field of computer technology. One specific embodiment of the method includes: responding to a business application access request, configuring switch configuration information for adjusting the business log level corresponding to the business application, wherein the switch configuration information indicates the switch status and current business log level; sending the switch configuration information to the client corresponding to the business application, so that the client determines the log output strategy corresponding to the business application based on the switch configuration information. This embodiment achieves unified management and maintenance of business log level adjustment, improves business log processing efficiency, and enables rapid online adjustment of business log levels, effectively ensuring the stability and timeliness of the business system and enhancing user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a business log processing method, apparatus, and system. Background Technology

[0002] Outputting business logs generated by business applications connected to the business system helps to quickly troubleshoot the cause of faults and improves the timeliness of handling customer complaints. Furthermore, outputting business logs according to business log levels—different business log levels indicate the types of business logs that need to be printed in different situations—further helps to ensure the secure operation of the system and improve the user experience.

[0003] At least the following problems exist in the relevant technology:

[0004] The switch logic for adjusting business log levels in related technologies is set in the corresponding business system, which makes it difficult to achieve unified management and maintenance of business log level adjustments, resulting in low efficiency in business log processing. At the same time, when faced with uninterrupted business and a surge in the number of business logs, it is difficult to quickly implement online adjustments to business log levels, resulting in a decline in the service performance of the business system, low stability and timeliness of the business system, and a poor user experience. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a business log processing method, apparatus, and system that can control the switching logic of business log level adjustment through the management terminal, thereby realizing unified management and maintenance of business log level adjustment and improving business log processing efficiency; at the same time, combined with the configured business log monitoring indicators, it can realize online rapid adjustment of business log level, effectively ensuring the stability and timeliness of the business system and improving user experience.

[0006] To achieve the above objectives, according to a first aspect of the present invention, a business log processing method is provided, applied to a server, comprising:

[0007] In response to a business application access request, configure the switch configuration information for adjusting the business log level corresponding to the business application. The switch configuration information indicates the switch status and current business log level of the business log.

[0008] The switch configuration information is sent to the client corresponding to the business application, so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information.

[0009] Furthermore, the switch configuration information also includes the enabling method for adjusting the business log level and the business log monitoring metrics; the switch configuration information is sent to the client corresponding to the business application, including:

[0010] In response to the automatic start mode, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the corresponding business log level adjustment information and sends the level adjustment information and switch configuration information to the client corresponding to the business application.

[0011] In response to the manual activation method, the system obtains business requirements, generates the corresponding level adjustment information for the business log based on the business requirements, and sends the level adjustment information and switch configuration information to the client corresponding to the business application.

[0012] Furthermore, if the activation method is set to automatic activation, it also includes:

[0013] Determine the activation cycle for adjusting business log levels, and monitor the corresponding performance metrics on the server side according to the activation cycle to compare business log monitoring metrics with performance metrics.

[0014] Furthermore, the client includes multiple log storage instances, and after sending the level adjustment information and switch configuration information to the client corresponding to the business application, it also includes:

[0015] The client adjusts the business log level of the business application based on the level adjustment information, multiple log storage instances, and switch configuration information, and adjusts the corresponding log output strategy, and stores the adjustment results.

[0016] Obtain the adjustment results and update the current business log level and business log monitoring metrics corresponding to the business application based on the adjustment results.

[0017] According to a second aspect of the present invention, a business log processing method is provided, applied to a client, comprising:

[0018] Send a business application access request to the server so that the server can configure the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request; wherein, the switch configuration information indicates the switch status and the current business log level corresponding to the business log.

[0019] Receive the switch configuration information sent by the server and determine the log output strategy corresponding to the business application based on the switch configuration information.

[0020] Furthermore, it also includes:

[0021] Receive level adjustment information;

[0022] The log output strategy for the business application is determined based on the level adjustment information and switch configuration information.

[0023] Furthermore, determining the log output strategy for business applications based on level adjustment information and switch configuration information also includes:

[0024] Obtain multiple log storage instances from the server;

[0025] Adjust the business log level corresponding to the business application based on the level adjustment information, multiple log storage instances, and switch configuration information, and adjust the corresponding log output strategy accordingly, and store the adjustment results.

[0026] According to a third aspect of the present invention, a business log processing apparatus is provided, disposed on a server, comprising:

[0027] The configuration module is used to respond to business application access requests and configure the switch configuration information for adjusting the business log level corresponding to the business application. The switch configuration information indicates the switch status and current business log level of the business log.

[0028] The switch configuration information sending module is used to send switch configuration information to the client corresponding to the business application, so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information.

[0029] According to a fourth aspect of the present invention, a business log processing apparatus is provided, disposed on a client, comprising:

[0030] The business application access request sending module is used to send a business application access request to the server so that the server can configure the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request; wherein, the switch configuration information indicates the switch status and the current business log level of the business log.

[0031] The processing module is used to receive the switch configuration information sent by the server and determine the log output strategy corresponding to the business application based on the switch configuration information.

[0032] According to a fifth aspect of the present invention, a business log processing system is provided, comprising: the business log processing apparatus provided in the third aspect of the above embodiments and the business log processing apparatus provided in the fourth aspect of the above embodiments.

[0033] According to a sixth aspect of the present invention, an electronic device is provided, comprising:

[0034] One or more processors;

[0035] Storage device for storing one or more programs.

[0036] When one or more programs are executed by one or more processors, the one or more processors implement any of the business log processing methods described above.

[0037] According to a seventh aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the above-described business log processing methods.

[0038] One embodiment of the above invention has the following advantages or beneficial effects: By employing a technical means of configuring switch configuration information for adjusting the business log level corresponding to the business application in response to a business application access request, wherein the switch configuration information indicates the switch status and current business log level of the business log; and sending the switch configuration information to the client corresponding to the business application so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information, this invention overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, leading to difficulties in achieving unified management and maintenance of business log level adjustments, low business log processing efficiency, decreased service performance of the business system, and poor user experience. This invention achieves the ability to control the switch logic for adjusting the business log level through the management terminal, realizing unified management and maintenance of business log level adjustments and improving business log processing efficiency. Simultaneously, by combining the configured business log monitoring indicators to achieve rapid online adjustment of the business log level, it effectively ensures the stability and timeliness of the business system and improves the user experience.

[0039] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0040] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0041] Figure 1 This is a schematic diagram of the main flow of the business log processing method provided according to the first embodiment of the present invention;

[0042] Figure 2 This is a schematic diagram of the main flow of the business log processing method provided according to the second embodiment of the present invention;

[0043] Figure 3 This is a schematic diagram of the main modules of the business log processing device provided according to the third embodiment of the present invention;

[0044] Figure 4 This is a schematic diagram of the main modules of the business log processing device provided according to the fourth embodiment of the present invention;

[0045] Figure 5 This is a schematic diagram of the main modules of the business log processing system provided according to the fifth embodiment of the present invention;

[0046] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0047] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0048] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0049] Figure 1 This is a schematic diagram of the main flow of the business log processing method provided in the first embodiment of the present invention; as shown below. Figure 1 As shown, the business log processing method provided in this embodiment of the invention is applied to the server side and mainly includes:

[0050] Step S101: In response to the business application access request, configure the switch configuration information for adjusting the business log level corresponding to the business application. The switch configuration information indicates the switch status and the current business log level corresponding to the business log.

[0051] Specifically, according to an embodiment of the present invention, in response to a business application access request, a business application node is accessed on the server side, and switch configuration information corresponding to the business application is configured to manage the ownership of the business log level adjustment switch, and the switch configuration information is persistently stored. In one specific embodiment, the business application access request includes a business application code. Further, the business application access request may also include corresponding application member information. Through the configured switch configuration information, only the aforementioned application members can be allowed to have the permission to operate the business log level adjustment switch under that business application, so as to ensure the safe and standardized use of the level adjustment switch.

[0052] Preferably, according to an embodiment of the present invention, after the business application is accessed on the server side, a client usage key can be randomly generated for permission control of the client corresponding to the business application.

[0053] According to a preferred embodiment of the present invention, the basic configuration description information corresponding to the business log is also configured in the switch configuration information, mainly including the business line to which the business log belongs (or the corresponding business type, etc.), the impact of the log level (for example, if a large number of error logs are printed out in a very short time, the memory of the system server buffer area will be quickly exhausted, thereby slowing down the main thread and causing the overall service performance to decline), so as to adjust the business log level later and ensure the safe and stable operation of the business system / server.

[0054] Step S102: Send the switch configuration information to the client corresponding to the business application, so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information.

[0055] Specifically, according to an embodiment of the present invention, the above-mentioned switch configuration information further includes the enabling method for adjusting the business log level and business log monitoring metrics; sending the switch configuration information to the client corresponding to the business application includes:

[0056] In response to the automatic start mode, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the corresponding business log level adjustment information and sends the level adjustment information and switch configuration information to the client corresponding to the business application.

[0057] In response to the manual activation method, the system obtains business requirements, generates the corresponding level adjustment information for the business log based on the business requirements, and sends the level adjustment information and switch configuration information to the client corresponding to the business application.

[0058] Specifically, the aforementioned switch configuration information indicates the on / off permissions (i.e., the specific business log output strategy) for adjusting the business log level output by the business application. The client can determine whether to enable business log level adjustment based on the switch status, activation method, and current business log level indicated in the switch configuration information (i.e., the client can dynamically set the business log output level for the business application based on the switch configuration information). Through the above settings, by comparing server-side performance metrics and business log monitoring metrics, automatic activation of business log level adjustment is achieved. The activation information and corresponding level adjustment information (such as business log downgrading) are sent to the client, allowing the client to dynamically set the business log level or disable the business log output stream object based on the log storage instance. This enables rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0059] According to embodiments of the present invention, the business log monitoring metrics include: business interface TP99 (the minimum time required to satisfy 99% of network requests), time consumption percentage, disk busy rate, disk utilization rate, and other metric information. Furthermore, the switch configuration information also indicates the monitoring platform (e.g., SGM (Service Governance and Monitoring), UMP (Unified Monitoring Platform), MDC (Unified Monitoring Platform, Monitoring Data Center), etc.), adjusts the switch start trigger conditions (e.g., TP99 greater than 3000ms, log printing time consumption percentage greater than 30%, etc.), and the logical relationships (AND / OR) between the trigger conditions.

[0060] Furthermore, according to an embodiment of the present invention, if the opening method is automatic opening, it further includes:

[0061] Determine the activation cycle for adjusting business log levels, and monitor the corresponding performance metrics on the server side according to the activation cycle to compare business log monitoring metrics with performance metrics.

[0062] Specifically, according to an embodiment of the present invention, if the activation method is automatic activation, a scheduled task can be created through the API of the unified scheduling platform TaskSchedule. When the task is triggered for execution, it is determined whether the activation time has been reached. If the activation time has been reached, the log switch status can be automatically changed to the activated state, and then the switch configuration information can be sent to the client via the API of the configuration center. If the activation method is automatic activation, the switch for adjusting the business log level takes effect immediately after publication, that is, the switch status is updated immediately, and the switch configuration information is sent via the API of the configuration center.

[0063] Preferably, according to an embodiment of the present invention, the client includes multiple log storage instances, and after the step of sending the level adjustment information and switch configuration information to the client corresponding to the business application, the method further includes:

[0064] The client adjusts the business log level of the business application based on the level adjustment information, multiple log storage instances, and switch configuration information, and adjusts the corresponding log output strategy, and stores the adjustment results.

[0065] Obtain the adjustment results and update the current business log level and business log monitoring metrics corresponding to the business application based on the adjustment results.

[0066] According to an embodiment of the present invention, after a business application accesses the server, when the business system on the server starts, the client obtains the logging framework currently applicable to the business system from the server and retrieves multiple log storage instances (Logger memory instances) from the business system configuration file. Specifically, these multiple log storage instances can be cached in a memory instance container (Concurrent HashMap). Upon receiving switch configuration information and level adjustment information sent by the server, the client can iterate through the multiple Logger memory instances in the memory instance container to adjust the business log level corresponding to the business application and adjust the corresponding log output strategy. Through the above settings, the business log level can be dynamically set or the log output stream object can be turned off, realizing business log level adjustment and switch control. This facilitates unified management and maintenance of business log level adjustments and improves business log processing efficiency.

[0067] According to the technical solution of this embodiment of the invention, by adopting a technical means of configuring switch configuration information for adjusting the business log level corresponding to the business application in response to the business application access request, wherein the switch configuration information indicates the switch status and current business log level of the business log; and sending the switch configuration information to the client corresponding to the business application so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information, this overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, making it difficult to achieve unified management and maintenance of business log level adjustment, resulting in low business log processing efficiency, decreased service performance of the business system, and poor user experience. This achieves the technical effect of enabling control of the switch logic for adjusting the business log level through the management terminal, realizing unified management and maintenance of business log level adjustment, and improving business log processing efficiency; at the same time, combined with the configured business log monitoring indicators, it enables rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0068] Figure 2 This is a schematic diagram of the main flow of the business log processing method provided according to the second embodiment of the present invention; as shown below. Figure 2 As shown, the business log processing method provided in this embodiment of the invention is applied to the client and mainly includes:

[0069] Step S201: Send a business application access request to the server so that the server can configure the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request; wherein, the switch configuration information indicates the switch status and the current business log level corresponding to the business log.

[0070] Specifically, according to an embodiment of the present invention, the client obtains the business application code corresponding to the business application to be processed, and sends the business application access request including the business application code to the server, so that the server configures the switch configuration information for adjusting the business log level.

[0071] Specifically, the business application access request may also include the corresponding application member information. Through the configured switch configuration information, only the above-mentioned application members may be allowed to operate the business log level adjustment switch under the business application, so as to ensure the safe and standardized use of the level adjustment switch.

[0072] Preferably, according to an embodiment of the present invention, after the business application is accessed on the server side, a client usage key can be randomly generated for permission control of the client corresponding to the business application.

[0073] According to a preferred embodiment of the present invention, the basic configuration description information corresponding to the business log is also configured in the switch configuration information, mainly including the business line to which the business log belongs (or the corresponding business type, etc.), the impact of the log level (for example, if a large number of error logs are printed out in a very short time, the memory of the system server buffer area will be quickly exhausted, thereby slowing down the main thread and causing the overall service performance to decline), so as to adjust the business log level later and ensure the safe and stable operation of the business system / server.

[0074] Step S202: Receive the switch configuration information sent by the server and determine the log output strategy corresponding to the business application based on the switch configuration information.

[0075] Specifically, according to embodiments of the present invention, the above method further includes:

[0076] Receive level adjustment information; determine the log output strategy corresponding to the business application based on the level adjustment information and switch configuration information.

[0077] The level adjustment information is generated by the server.

[0078] By obtaining level adjustment information (such as business log downgrading) from the server through the above settings, the client can dynamically set the business log level or disable the business log output stream object in combination with the log storage instance, so as to realize the rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0079] Furthermore, according to an embodiment of the present invention, determining the log output strategy corresponding to the service application based on the level adjustment information and the switch configuration information further includes:

[0080] Obtain multiple log storage instances from the server;

[0081] Adjust the business log level corresponding to the business application based on the level adjustment information, multiple log storage instances, and switch configuration information, and adjust the corresponding log output strategy accordingly, and store the adjustment results.

[0082] According to an embodiment of the present invention, after a business application accesses the server, when the business system on the server starts, the client obtains the current applicable logging framework for the business system from the server and retrieves multiple log storage instances from the business system configuration file. Specifically, these multiple log storage instances can be cached in a memory instance container. Upon receiving switch configuration information and level adjustment information sent by the server, the client can iterate through the multiple log storage instances in the memory instance container to adjust the business log level corresponding to the business application and adjust the corresponding log output strategy. Through the above settings, the business log level can be dynamically set or the log output stream object can be turned off, realizing business log level adjustment and switch control. This facilitates unified management and maintenance of business log level adjustments and improves business log processing efficiency.

[0083] According to the technical solution of this embodiment of the invention, by sending a business application access request to the server, enabling the server to configure the switch configuration information for adjusting the business log level corresponding to the business application based on the business application access request; wherein the switch configuration information indicates the switch status and current business log level of the business log; and by receiving the switch configuration information sent by the server and determining the log output strategy corresponding to the business application based on the switch configuration information, this invention overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, making it difficult to achieve unified management and maintenance of business log level adjustment, resulting in low business log processing efficiency, decreased service performance of the business system, and poor user experience. This invention achieves the technical effect of enabling control of the switch logic for adjusting the business log level through the management end, realizing unified management and maintenance of business log level adjustment, and improving business log processing efficiency; simultaneously, by combining the configured business log monitoring indicators to achieve rapid online adjustment of the business log level, it effectively ensures the stability and timeliness of the business system and improves the user experience.

[0084] Figure 3 This is a schematic diagram of the main modules of the business log processing device provided in the third embodiment of the present invention; as shown. Figure 3 As shown, the business log processing device 300 provided in this embodiment of the invention is located on the server side and mainly includes:

[0085] The configuration module 301 is used to respond to the access request of the business application and configure the switch configuration information for adjusting the business log level corresponding to the business application. The switch configuration information indicates the switch status and the current business log level corresponding to the business log.

[0086] Specifically, according to an embodiment of the present invention, the configuration module 301 is further configured to:

[0087] In response to a business application access request, the business application node is accessed on the server side, and the corresponding switch configuration information for the business application is configured to manage the ownership of the business log level adjustment switch, and the switch configuration information is persistently stored.

[0088] In one specific implementation, the business application access request includes a business application code. Furthermore, the business application access request may also include corresponding application member information. Through the configured switch configuration information, only the aforementioned application members may be allowed to operate the business log level adjustment switch under the business application, so as to ensure the safe and standardized use of the level adjustment switch.

[0089] Preferably, according to an embodiment of the present invention, after the business application is accessed on the server side, a client usage key can be randomly generated for permission control of the client corresponding to the business application.

[0090] According to a preferred embodiment of the present invention, the basic configuration description information corresponding to the business log is also configured in the switch configuration information, mainly including the business line to which the business log belongs (or the corresponding business type, etc.), the impact of the log level (for example, if a large number of error logs are printed out in a very short time, the memory of the system server buffer area will be quickly exhausted, thereby slowing down the main thread and causing the overall service performance to decline), so as to adjust the business log level later and ensure the safe and stable operation of the business system / server.

[0091] The switch configuration information sending module 302 is used to send switch configuration information to the client corresponding to the business application, so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information.

[0092] Specifically, according to an embodiment of the present invention, the above-mentioned switch configuration information further includes the activation method for service log level adjustment and service log monitoring indicators; the switch configuration information sending module 302 is also used for:

[0093] In response to the automatic start mode, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the corresponding business log level adjustment information and sends the level adjustment information and switch configuration information to the client corresponding to the business application.

[0094] In response to the manual activation method, the system obtains business requirements, generates the corresponding level adjustment information for the business log based on the business requirements, and sends the level adjustment information and switch configuration information to the client corresponding to the business application.

[0095] By comparing server-side performance metrics and business log monitoring metrics, the automatic activation of business log level adjustment is achieved. The activation information and corresponding level adjustment information (such as business log downgrading) are sent to the client. This allows the client to dynamically set the business log level or disable the business log output stream object based on the log storage instance, enabling rapid online adjustment of the business log level. This effectively ensures the stability and timeliness of the business system and improves the user experience.

[0096] According to an embodiment of the present invention, the business log monitoring metrics include: business interface TP99 (the minimum time required to satisfy 99% of network requests), time consumption percentage, disk busy rate, disk utilization rate, and other metric information. Furthermore, the switch configuration information also indicates the monitoring platform (e.g., SGM, UMP, MDC, etc.), adjusts the switch start trigger conditions (e.g., TP99 greater than 3000ms, log printing time consumption percentage greater than 30%, etc.), and the logical relationships (AND / OR, and / or) between the trigger conditions.

[0097] Furthermore, according to an embodiment of the present invention, the above-mentioned business log processing device 300 further includes an activation cycle determination module, which, if the activation mode is automatic activation, is used for:

[0098] Determine the activation cycle for adjusting business log levels, and monitor the corresponding performance metrics on the server side according to the activation cycle to compare business log monitoring metrics with performance metrics.

[0099] Specifically, according to an embodiment of the present invention, if the activation method is automatic activation, a scheduled task can be created through the API of the unified scheduling platform TaskSchedule. When the task is triggered for execution, it is determined whether the activation time has been reached. If the activation time has been reached, the log switch status can be automatically changed to the activated state, and then the switch configuration information can be sent to the client via the API of the configuration center. If the activation method is automatic activation, the switch for adjusting the business log level takes effect immediately after publication, that is, the switch status is updated immediately, and the switch configuration information is sent via the API of the configuration center.

[0100] Preferably, according to an embodiment of the present invention, the client includes multiple log storage instances; the above-mentioned business log processing device 300 further includes an adjustment module, which, after the step of sending level adjustment information and switch configuration information to the client corresponding to the business application, is used to:

[0101] The client adjusts the business log level of the business application based on the level adjustment information, multiple log storage instances, and switch configuration information, and adjusts the corresponding log output strategy, and stores the adjustment results.

[0102] Obtain the adjustment results and update the current business log level and business log monitoring metrics corresponding to the business application based on the adjustment results.

[0103] According to an embodiment of the present invention, after a business application accesses the server, when the business system on the server starts, the client obtains the logging framework currently applicable to the business system from the server and retrieves multiple log storage instances (Logger memory instances) from the business system configuration file. Specifically, these multiple log storage instances can be cached in a memory instance container (Concurrent HashMap). Upon receiving switch configuration information and level adjustment information sent by the server, the client can iterate through the multiple Logger memory instances in the memory instance container to adjust the business log level corresponding to the business application and adjust the corresponding log output strategy. Through the above settings, the business log level can be dynamically set or the log output stream object can be turned off, realizing business log level adjustment and switch control. This facilitates unified management and maintenance of business log level adjustments and improves business log processing efficiency.

[0104] According to the technical solution of this embodiment of the invention, by adopting a technical means of configuring switch configuration information for adjusting the business log level corresponding to the business application in response to the business application access request, wherein the switch configuration information indicates the switch status and current business log level of the business log; and sending the switch configuration information to the client corresponding to the business application so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information, this overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, making it difficult to achieve unified management and maintenance of business log level adjustment, resulting in low business log processing efficiency, decreased service performance of the business system, and poor user experience. This achieves the technical effect of enabling control of the switch logic for adjusting the business log level through the management terminal, realizing unified management and maintenance of business log level adjustment, and improving business log processing efficiency; at the same time, combined with the configured business log monitoring indicators, it enables rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0105] Figure 4 This is a schematic diagram of the main modules of the business log processing device provided according to the fourth embodiment of the present invention; as shown. Figure 4 As shown, the business log processing device 400 provided in this embodiment of the invention is installed on the client side and mainly includes:

[0106] The business application access request sending module 401 is used to send a business application access request to the server so that the server can configure the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request; wherein, the switch configuration information indicates the switch status and the current business log level corresponding to the business log.

[0107] Specifically, according to an embodiment of the present invention, the client obtains the business application code corresponding to the business application to be processed, and sends the business application access request including the business application code to the server, so that the server configures the switch configuration information for adjusting the business log level.

[0108] Specifically, the business application access request may also include the corresponding application member information. Through the configured switch configuration information, only the above-mentioned application members may be allowed to operate the business log level adjustment switch under the business application, so as to ensure the safe and standardized use of the level adjustment switch.

[0109] Preferably, according to an embodiment of the present invention, after the business application is accessed on the server side, a client usage key can be randomly generated for permission control of the client corresponding to the business application.

[0110] According to a preferred embodiment of the present invention, the basic configuration description information corresponding to the business log is also configured in the switch configuration information, mainly including the business line to which the business log belongs (or the corresponding business type, etc.), the impact of the log level (for example, if a large number of error logs are printed out in a very short time, the memory of the system server buffer area will be quickly exhausted, thereby slowing down the main thread and causing the overall service performance to decline), so as to adjust the business log level later and ensure the safe and stable operation of the business system / server.

[0111] The processing module 402 is used to receive the switch configuration information sent by the server and determine the log output strategy corresponding to the business application based on the switch configuration information.

[0112] Specifically, according to an embodiment of the present invention, the processing module 402 is further configured to:

[0113] Receive level adjustment information; determine the log output strategy corresponding to the business application based on the level adjustment information and switch configuration information.

[0114] The level adjustment information is generated by the server.

[0115] By obtaining level adjustment information (such as business log downgrading) from the server through the above settings, the client can dynamically set the business log level or disable the business log output stream object in combination with the log storage instance, so as to realize the rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0116] Furthermore, according to an embodiment of the present invention, the processing module 402 is also used for:

[0117] Obtain multiple log storage instances from the server;

[0118] Adjust the business log level corresponding to the business application based on the level adjustment information, multiple log storage instances, and switch configuration information, and adjust the corresponding log output strategy accordingly, and store the adjustment results.

[0119] According to an embodiment of the present invention, after a business application accesses the server, when the business system on the server starts, the client obtains the current applicable logging framework for the business system from the server and retrieves multiple log storage instances from the business system configuration file. Specifically, these multiple log storage instances can be cached in a memory instance container. Upon receiving switch configuration information and level adjustment information sent by the server, the client can iterate through the multiple log storage instances in the memory instance container to adjust the business log level corresponding to the business application and adjust the corresponding log output strategy. Through the above settings, the business log level can be dynamically set or the log output stream object can be turned off, realizing business log level adjustment and switch control. This facilitates unified management and maintenance of business log level adjustments and improves business log processing efficiency.

[0120] According to the technical solution of this embodiment of the invention, by sending a business application access request to the server, enabling the server to configure the switch configuration information for adjusting the business log level corresponding to the business application based on the business application access request; wherein the switch configuration information indicates the switch status and current business log level of the business log; and by receiving the switch configuration information sent by the server and determining the log output strategy corresponding to the business application based on the switch configuration information, this invention overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, making it difficult to achieve unified management and maintenance of business log level adjustment, resulting in low business log processing efficiency, decreased service performance of the business system, and poor user experience. This invention achieves the technical effect of enabling control of the switch logic for adjusting the business log level through the management end, realizing unified management and maintenance of business log level adjustment, and improving business log processing efficiency; simultaneously, by combining the configured business log monitoring indicators to achieve rapid online adjustment of the business log level, it effectively ensures the stability and timeliness of the business system and improves the user experience.

[0121] Figure 5 This is a schematic diagram of the main modules of the business log processing system provided in the fifth embodiment of the present invention; as shown. Figure 5 As shown, the business log processing system 500 provided in this embodiment of the invention mainly includes:

[0122] Server-side 300: Used to respond to business application access requests, configure the switch configuration information for adjusting the business log level corresponding to the business application. The switch configuration information indicates the switch status and current business log level of the business log. The switch configuration information is sent to the client corresponding to the business application so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information.

[0123] Client 400: Used to send a business application access request to the server, so that the server can configure the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request; wherein, the switch configuration information indicates the switch status and current business log level of the business log; receive the switch configuration information sent by the server, and determine the log output strategy corresponding to the business application according to the switch configuration information.

[0124] According to the technical solution of this embodiment of the invention, by adopting a technical means of configuring switch configuration information for adjusting the business log level corresponding to the business application in response to the business application access request, wherein the switch configuration information indicates the switch status and current business log level of the business log; and sending the switch configuration information to the client corresponding to the business application so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information, this overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, making it difficult to achieve unified management and maintenance of business log level adjustment, resulting in low business log processing efficiency, decreased service performance of the business system, and poor user experience. This achieves the technical effect of enabling control of the switch logic for adjusting the business log level through the management terminal, realizing unified management and maintenance of business log level adjustment, and improving business log processing efficiency; at the same time, combined with the configured business log monitoring indicators, it enables rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0125] Figure 6 An exemplary system architecture 600 is shown that can be applied to the business log processing method or business log processing apparatus of the present invention.

[0126] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, and 603, network 604, and server 605 (this architecture is merely an example; the components included in a specific architecture may be adjusted according to the specific application). Network 604 serves as the medium for providing a communication link between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0127] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as business data processing applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0128] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0129] Server 605 can be a server that provides various services, such as a server that processes data from user terminal devices 601, 602, and 603 (for example only). This server can analyze and process data such as received business application access requests, and feed back the processing results (such as switch configuration information and log output policies—for example only) to the terminal devices.

[0130] It should be noted that the business log processing method provided in this embodiment of the invention is generally executed by server 605, and correspondingly, the business log processing device is generally set in server 605.

[0131] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0132] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing terminal devices or servers of the present invention. Figure 7 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0133] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0134] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0135] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.

[0136] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0138] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may be described as including a configuration module and a switch configuration information sending module; or a processor may include a business application access request sending module and a processing module. The names of these modules do not necessarily limit the module itself; for example, a configuration module may also be described as "a module for configuring switch configuration information for adjusting the business log level corresponding to a business application in response to a business application access request."

[0139] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: in response to a service application access request, configuring switch configuration information for adjusting the service log level corresponding to the service application, wherein the switch configuration information indicates the switch state and current service log level corresponding to the service log; and sending the switch configuration information to a client corresponding to the service application, so that the client determines the log output strategy corresponding to the service application based on the switch configuration information.

[0140] According to the technical solution of this embodiment of the invention, by adopting a technical means of configuring switch configuration information for adjusting the business log level corresponding to the business application in response to the business application access request, wherein the switch configuration information indicates the switch status and current business log level of the business log; and sending the switch configuration information to the client corresponding to the business application so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information, this overcomes the technical problems in related technologies where the switch logic for adjusting the business log level is set in the corresponding business system, making it difficult to achieve unified management and maintenance of business log level adjustment, resulting in low business log processing efficiency, decreased service performance of the business system, and poor user experience. This achieves the technical effect of enabling control of the switch logic for adjusting the business log level through the management terminal, realizing unified management and maintenance of business log level adjustment, and improving business log processing efficiency; at the same time, combined with the configured business log monitoring indicators, it enables rapid online adjustment of the business log level, effectively ensuring the stability and timeliness of the business system and improving the user experience.

[0141] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A business log processing method, characterized in that, Applied to the server side, including: In response to a business application access request, configure the switch configuration information for adjusting the business log level corresponding to the business application, wherein the switch configuration information indicates the switch status and the current business log level corresponding to the business log; The switch configuration information is sent to the client corresponding to the business application, so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information; The switch configuration information also includes the enabling method for adjusting the business log level and business log monitoring metrics; sending the switch configuration information to the client corresponding to the business application includes: In response to the activation mode being set to automatic activation, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the level adjustment information corresponding to the business log and sends the level adjustment information and the switch configuration information to the client corresponding to the business application.

2. The business log processing method according to claim 1, characterized in that, The step of sending the switch configuration information to the client corresponding to the business application further includes: In response to the activation method being manual activation, the system obtains business requirements, generates level adjustment information corresponding to the business log based on the business requirements, and sends the level adjustment information and the switch configuration information to the client corresponding to the business application.

3. The business log processing method according to claim 2, characterized in that, If the activation method is automatic activation, it also includes: Determine the activation cycle for adjusting the business log level, and monitor the corresponding performance indicators on the server side according to the activation cycle, so as to compare the business log monitoring indicators with the performance indicators.

4. The business log processing method according to claim 2, characterized in that, The client includes multiple log storage instances. After the step of sending the level adjustment information and the switch configuration information to the client corresponding to the business application, the method further includes: The client is used to adjust the business log level corresponding to the business application based on the level adjustment information, the multiple log storage instances, and the switch configuration information, and to adjust the corresponding log output strategy and store the adjustment results. Obtain the adjustment results, and update the current business log level and business log monitoring metrics corresponding to the business application based on the adjustment results.

5. A business log processing method, characterized in that, Applied to the client side, including: A business application access request is sent to the server, so that the server configures the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request, and sends the switch configuration information to the client corresponding to the business application; wherein, the switch configuration information indicates the switch status and current business log level corresponding to the business log; Receive the switch configuration information sent by the server, and determine the log output strategy corresponding to the business application based on the switch configuration information; The switch configuration information also includes the enabling method for adjusting the business log level and business log monitoring metrics; sending the switch configuration information to the client corresponding to the business application includes: In response to the activation mode being set to automatic activation, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the level adjustment information corresponding to the business log and sends the level adjustment information and the switch configuration information to the client corresponding to the business application.

6. The business log processing method according to claim 5, characterized in that, Also includes: Receive level adjustment information; The log output strategy corresponding to the business application is determined based on the level adjustment information and the switch configuration information.

7. The business log processing method according to claim 6, characterized in that, The step of determining the log output strategy corresponding to the service application based on the level adjustment information and the switch configuration information further includes: Obtain multiple log storage instances from the server; Adjust the business log level corresponding to the business application based on the level adjustment information, the multiple log storage instances, and the switch configuration information, and adjust the corresponding log output strategy, and store the adjustment results.

8. A business log processing device, characterized in that, Server-side settings include: The configuration module is used to respond to the access request of the business application and configure the switch configuration information for adjusting the business log level corresponding to the business application, wherein the switch configuration information indicates the switch status and the current business log level corresponding to the business log; A switch configuration information sending module is used to send the switch configuration information to the client corresponding to the business application, so that the client can determine the log output strategy corresponding to the business application based on the switch configuration information. The switch configuration information also includes the enabling method for adjusting the service log level and the service log monitoring metrics; the switch configuration information sending module is also used for: In response to the activation mode being set to automatic activation, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the level adjustment information corresponding to the business log and sends the level adjustment information and the switch configuration information to the client corresponding to the business application.

9. A business log processing device, characterized in that, Settings on the client side include: A business application access request sending module is used to send a business application access request to the server, so that the server configures the switch configuration information for adjusting the business log level corresponding to the business application according to the business application access request, and sends the switch configuration information to the client corresponding to the business application; wherein, the switch configuration information indicates the switch status and current business log level corresponding to the business log; The processing module is used to receive the switch configuration information sent by the server and determine the log output strategy corresponding to the business application based on the switch configuration information. The switch configuration information also includes the enabling method for adjusting the business log level and business log monitoring metrics; sending the switch configuration information to the client corresponding to the business application includes: In response to the activation mode being set to automatic activation, the system monitors the corresponding performance metrics on the server side, compares the business log monitoring metrics with the performance metrics, and determines whether to enable business log level adjustment based on the comparison results. If so, it generates the level adjustment information corresponding to the business log and sends the level adjustment information and the switch configuration information to the client corresponding to the business application.

10. A business log processing system, characterized in that, include: The business log processing apparatus of claim 8 and the business log processing apparatus of claim 9.

11. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4, 5-7.

12. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4, 5-7.

Citation Information

Patent Citations

  • Terminal log reporting method, device and system

    CN104253704A