CN113204533A - Log level adjusting method and device, computer equipment and storage medium - Google Patents

Log level adjusting method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113204533A
CN113204533A CN202110595198.2A CN202110595198A CN113204533A CN 113204533 A CN113204533 A CN 113204533A CN 202110595198 A CN202110595198 A CN 202110595198A CN 113204533 A CN113204533 A CN 113204533A
Authority
CN
China
Prior art keywords
log
target
level
determining
annotation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110595198.2A
Other languages
Chinese (zh)
Inventor
周成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202110595198.2A priority Critical patent/CN113204533A/en
Publication of CN113204533A publication Critical patent/CN113204533A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to the field of process optimization, a log adjustment interface is determined according to target log annotation in the starting stage of an application program, a log level adjustment request is received through the log adjustment interface in the running stage of the application program, real-time log level adjustment is achieved according to the log level adjustment request, and convenience in adjusting log levels is improved. A log level adjustment method, apparatus, computer device and storage medium are provided, the method includes: when the target log annotation is detected, determining a log adjustment interface according to the target log annotation; if the call operation of the log adjustment interface is detected, acquiring a log level adjustment request according to the call operation; determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request; and adjusting the current log level of the target log object to the target log level.

Description

Log level adjusting method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of process optimization, and in particular, to a method and an apparatus for adjusting log levels, a computer device, and a storage medium.
Background
The Spring Boot is a completely new framework for simplifying the initial building and development process of the Spring application. In a production environment, when the log level of an application in the Spring Boot framework needs to be adjusted, the log level is generally adjusted by restarting the application after modifying a configuration file or by an activator component. If the application program is restarted, the normal operation of the service system is influenced; if the order of the log is adjusted through the activator component, the system is bloated due to the fact that the activator component is too large and the configuration process is complicated, and the activator component needs to perform permission authentication again, so that convenience of adjusting the order of the log is greatly reduced.
Therefore, how to improve the convenience of log level adjustment becomes an urgent problem to be solved.
Disclosure of Invention
The application provides a log level adjusting method, a log level adjusting device, computer equipment and a storage medium.
In a first aspect, the present application provides a log level adjustment method, including:
when a target log annotation is detected, determining a log adjustment interface according to the target log annotation;
if the call operation of the log adjustment interface is detected, acquiring a log level adjustment request according to the call operation;
determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request;
and adjusting the current log level of the target log object to the target log level.
In a second aspect, the present application further provides a log level adjustment apparatus, including:
the adjusting interface determining module is used for determining a log adjusting interface according to the target log annotation when the target log annotation is detected;
the adjustment request receiving module is used for acquiring a log level adjustment request according to the calling operation if the calling operation of the log adjustment interface is detected;
the log information determining module is used for determining a target log object to be subjected to log level adjustment and a target log level according to the log level adjustment request;
and the log level adjusting module is used for adjusting the current log level of the target log object to the target log level.
In a third aspect, the present application further provides a computer device comprising a memory and a processor;
the memory for storing a computer program;
the processor is configured to execute the computer program and to implement the log level adjustment method as described above when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to implement the log level adjustment method as described above.
The application discloses a log level adjusting method, a device, computer equipment and a storage medium, wherein when a target log annotation is detected, a log adjusting interface is determined according to the target log annotation, so that the log adjusting interface can be determined according to the target log annotation in the starting stage of an application program; if the call operation of the log adjustment interface is detected, the log level adjustment request is obtained according to the call operation, so that the log level adjustment request can be received through the log adjustment interface in the running stage of the application program; the target log object to be subjected to log level adjustment and the target log level are determined according to the log level adjustment request, the current log level of the target log object is adjusted to the target log level, and the log level adjustment is performed without restarting an application program or by an activator component, so that the real-time log level adjustment can be performed according to the log level adjustment request, and the convenience of adjusting the log level is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a log level adjustment method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of sub-steps of determining a log adjustment interface provided by an embodiment of the present application;
fig. 3 is a schematic flowchart for acquiring control object information according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of a log level adjustment apparatus provided in an embodiment of the present application;
fig. 5 is a schematic block diagram of a structure of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The embodiment of the application provides a log level adjusting method and device, computer equipment and a storage medium. The log level adjusting method can be applied to a server or a terminal, the log adjusting interface is determined according to the target log annotation in the starting stage of the application program, the log level adjusting request is received through the log adjusting interface in the running stage of the application program, the log level adjustment can be carried out in real time according to the log level adjusting request, and convenience in adjusting the log level is improved.
The server may be an independent server or a server cluster. The terminal can be an electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer and the like.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
As shown in fig. 1, the log level adjustment method includes steps S10 through S40.
And step S10, when the target log annotation is detected, determining a log adjustment interface according to the target log annotation.
It should be noted that the log level adjustment method provided in the embodiment of the present application may be applied to a log level adjustment scenario of an application program in a Springboot framework. For example, during the startup phase of the application program, the exposed log reconciliation interface is determined according to the target log annotation; and receiving a log level adjustment request through a log adjustment interface in the running stage of the application program. Therefore, in a production environment, the log level can be adjusted in real time according to the log level adjustment request without restarting an application program or performing log level adjustment through an activator component, so that a complicated configuration process and permission log re-execution are avoided, and convenience in adjusting the log level is improved.
It should be noted that the log adjustment interface refers to an application program interface for adjusting the log level. Exposure means that the logging adjustment interface can be called by an external program.
In the embodiment of the application, an enablechengloglevel annotation can be added to the starting class in advance, so that a log adjusting interface can be automatically generated according to the detected enablechengegloglevel annotation in the starting stage of the application program by combining a reflection mechanism and an import selector, and a complicated configuration process is omitted.
Illustratively, the log annotation may be detected at application startup; and when the target log annotation is detected, determining a log conditioning interface according to the target log annotation. For example, all log annotations on the startup class may be scanned to obtain predefined target log annotations. Wherein, the target log annotation refers to a tag for enabling to change the log level; the target log annotation may be an enableconloglevel annotation.
By detecting the target log annotation at the starting stage of the application program, the log adjustment interface can be generated according to the detected target log annotation, the log adjustment request can be received through the log adjustment interface subsequently, the log level can be adjusted according to the log adjustment request, the application program does not need to be restarted, or the log level can be adjusted through the activator assembly, and the convenience of adjusting the log level is improved.
In the embodiment of the present application, when the target log annotation is detected, the log reconciliation interface may be determined according to the target log annotation. Referring to fig. 2, fig. 2 is a schematic flowchart illustrating sub-steps of determining a log adjustment interface according to an embodiment of the present application, and specifically includes the following steps S101 to S103.
And S101, determining a target import selector corresponding to the target log annotation, and acquiring control object information corresponding to the target import selector.
It should be noted that the import selector is configured to collect configuration information that needs to be imported, and the configuration information defines control object information to be instantiated. The target import selector may be an importer selector interface.
In some embodiments, determining a target import selector corresponding to the target log annotation may include: analyzing the target log annotation to obtain a target annotation value corresponding to the target log annotation; and determining a target import selector according to the target annotation value based on the corresponding relation between the preset annotation value and the import selector.
Illustratively, the target log annotation may be parsed to obtain an import annotation value in the target log annotation, thereby obtaining a target annotation value. The parsing refers to reading relevant information in the target log annotation. It should be noted that the import annotation value is written into the target log annotation at the encoding stage, and defines the import selector to be called. For example, import annotation values may be associated with import selectors that need to be invoked.
For example, after obtaining the target annotation value corresponding to the target log annotation, the target import selector may be determined according to the target annotation value based on the corresponding relationship between the preset annotation value and the import selector.
Referring to fig. 3, fig. 3 is a schematic flowchart for acquiring control object information according to an embodiment of the present disclosure. As shown in fig. 3, the obtaining of the control object information corresponding to the target import selector may include: analyzing the target import selector to obtain configuration information corresponding to the target import selector; and determining the control object information according to the configuration information.
It should be noted that the target import selector may indicate the external configuration information to be imported by using a selecteobjects method. Therefore, the target import selection can be analyzed, and the configuration information is determined by using a selecteobjects method.
Illustratively, the configuration information may be parsed to obtain control object information. The control object information may include interface information corresponding to a log adjustment interface called by an external program.
It should be noted that, control object information to be instantiated is defined in the configuration information; after the control object information is instantiated, a corresponding control object can be obtained.
Step S102, instantiation is carried out on the control object information, and a control object corresponding to the control object information is obtained.
For example, the control object information may be instantiated based on a preset reflection mechanism, and a control object corresponding to the control object information is obtained.
Wherein the preset reflection mechanism may be a Java reflection mechanism. It should be noted that the Java reflection mechanism is a function of dynamically acquiring information and dynamically calling an object. For example, in a running state, for any class, the Java reflection mechanism can acquire all the attributes and methods of the class; for any object, the Java reflection mechanism can invoke any of its methods and properties.
It is understood that instantiation refers to the process of creating an object (object) of a class by class. In the embodiment of the present application, the control object information may be regarded as one class.
And S103, determining the log adjusting interface according to the control object.
Illustratively, the log adjustment interface may be determined based on the interface contained in the control object. The communication Protocol of the log adjustment interface may be set to an HTTP (HyperText Transfer Protocol) Protocol. For example, the external program may invoke the log adjustment interface based on the HTTP protocol. By setting the communication protocol of the log adjustment interface as the HTTP protocol, the space can be reserved for the operation and maintenance tool for subsequent programming calls. It can be understood that when the operation and maintenance tool needs to access subsequently, the log adjustment interface can be accessed directly through the HTTP protocol.
It should be noted that, since the control object information includes interface information corresponding to the log adjustment interface provided for the external program to call, the control object obtained by instantiating the control object information includes the log adjustment interface. It is understood that a control object corresponds to a container integrating interfaces of various functions, and the control object can realize different functions through the integrated interfaces thereof. For example, adjusting the log level of a log object can be accomplished through a log adjustment interface.
By acquiring the control object information corresponding to the import selector, instantiating the control object information and determining the log adjustment interface according to the control object obtained by instantiation, the log adjustment interface can be subjected to authority control under an authority control system of the existing service system, another set of authority control system is not required to be adopted for carrying out authority control on the log adjustment interface, and system resources and labor cost can be saved.
In some embodiments, after determining the log adjustment interface according to the control object, the method may further include: acquiring a context environment object in an application program; adding the control object to the context environment object to update the context environment object, wherein updating the context environment object comprises adding the log adjustment interface to a preset application program interface list.
Illustratively, the control object may be added to a control reversal of control (IoC) container. It should be noted that the control reversal container is a container of the context object. The context environment object refers to the context environment when the application program runs; a context environment object for managing the application program interface list. When a control object is added to the control reversal container, the control reversal container updates the context environment object according to the log adjustment interface since the control object contains the log adjustment interface. For example, the log adjustment interface is added to the list of application program interfaces in the context environment object.
To further ensure privacy and security of the api list, the api list may be stored in a node of a blockchain.
By adding the log adjustment interface to the application program interface list, the external program can be made to call the log adjustment interface in the application program interface list.
Step S20, if the call operation of the log adjustment interface is detected, acquiring the log level adjustment request according to the call operation.
It should be noted that, during the running phase of the application program, the user can adjust the log level according to the actual requirement. For example, when a user needs to modify the log level of a log object in a certain class, the user may call the log adjustment interface to initiate a log level adjustment request.
Illustratively, when a call operation of the log adjustment interface is detected, the log level adjustment request is obtained according to the call operation. The log level adjustment request comprises class name information and log level information. The class name information is used for determining a target log object to be subjected to log level adjustment; the log level information is used to determine an adjusted log level of the target log object. It should be noted that, when the user initiates the log level adjustment request, the class name information and the log level information may be added to the log level adjustment request.
By detecting whether the log adjustment interface receives the calling operation, the log level adjustment request can be obtained through the log adjustment interface without additional authority authentication, and a user can conveniently and directly adjust the log level of the log object by calling the log adjustment interface.
Step S30, determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request.
It should be noted that, in the embodiment of the present application, the target log object and the target log level for performing the log level adjustment are determined by the log level adjustment request, so that the log object in a certain class can be accurately adjusted in the log level, and the required log can be more accurately printed in the production environment.
In some embodiments, determining a target log object and a target log level to be log-level adjusted according to the log-level adjustment request may include: determining a target log object to be subjected to log level adjustment according to the class name information; and determining a target log level according to the log level information.
Determining the target log object to be subjected to log level adjustment according to the class name information may include: acquiring a log context environment object; determining a target class in the log context environment object according to the class name information; and determining a target log object according to the log object in the target class.
It should be noted that the log context environment object refers to the running environment information corresponding to the log object, and may include the class where the log object is located.
Illustratively, the log context object may be obtained by a log factory class call to a method of obtaining the log context object. And then, according to the class name information, determining a target class in the log context environment object, and further determining a target log object according to the log object in the target class. Wherein the class name information may be a name of the class. It should be noted that, when recording the log, a log object is defined in each class, and then the log object is used to write the log; thus, a target log object may be determined based on the target class.
In some embodiments, when a user needs to adjust the log level of a log object in the com. LoggerContextloggerContext ═ (LoggerContext) loggerfactory.
Wherein, LoggerContext represents the data type of the log context object, and LoggerContext represents the name of the log context object. When determining the target log object according to the log object in the target class, the following function is used to implement: logger ═ loggreccoxt. The Logger represents the data type of the target log object, and the Logger represents the name of the target log object.
By determining the target log object to be subjected to the log level adjustment according to the class name information, the log level of the log object in a certain class can be adjusted more accurately, and compared with the packet level adjustment of an activator component, the adjustment granularity is finer and more accurate.
Illustratively, the log level information may include a log level of the target log object. It should be noted that, in the Java system, the log level is 8 levels; the priority is from high to low: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL. Wherein OFF is the highest level for closing log records; FATAL represents a serious error that causes the application to terminate prematurely; ERROR represents other runtime ERRORs or exceptions; WARN represents the use of an obsolete API, abuse of the API, potential errors, other undesirable or unexpected operating conditions; INFO represents interesting runtime events; DEBUG represents detailed information flowing through the system; TRACE represents the most detailed information; ALL means ALL log records are opened.
For example, when the log level information includes an INFO level, it indicates that the user needs to adjust the current log level of the target log object to the INFO level.
For another example, when the log level information includes an ALL level, it indicates that the user needs to adjust the current log level of the target log object to the ALL level.
And step S40, adjusting the current log level of the target log object to the target log level.
For example, after determining the target log object to be subjected to the log level adjustment and the target log level, the current log level of the target log object may be adjusted to the target log level. It should be noted that, by adjusting the current log level of the target log object to the target log level, the target log object can manage the log record according to the target log level and output the log record corresponding to the target log level.
For example, if the target log level is an INFO level, the method may be implemented by invoking a setLevel method, which is specifically as follows: logger.
For another example, if the target log level is an ALL level, the target log level may be implemented by calling a setLevel method, which is specifically as follows: logger.
By adjusting the current log level of the target log object to the target log level, the log level can be adjusted in real time according to the log level adjustment request, and convenience in adjusting the log level is improved.
According to the method for adjusting the log level, the target log annotation is detected at the starting stage of the application program, the log adjusting interface can be generated according to the detected target log annotation, the log adjusting request can be received through the log adjusting interface subsequently, the log level can be adjusted according to the log adjusting request, the application program does not need to be restarted, or the operator assembly does not need to be used for adjusting the log level, and convenience in adjusting the log level is improved; by acquiring the control object information corresponding to the import selector, instantiating the control object information and determining the log adjustment interface according to the control object obtained by instantiation, the authority control of the log adjustment interface under the authority control system of the existing service system can be realized, and another set of authority control system is not required to be adopted to carry out the authority control of the log adjustment interface, so that the system resources and the labor cost can be saved; by setting the communication protocol of the log adjustment interface as an HTTP (hyper text transport protocol), the reserved space of the operation and maintenance tool can be called for subsequent programming; by adding the log adjustment interface to the application program interface list, an external program can call the log adjustment interface in the application program interface list; by detecting whether the log adjustment interface receives the calling operation, the log level adjustment request can be acquired through the log adjustment interface without additional authority authentication, and a user can conveniently and directly adjust the log level of the log object by calling the log adjustment interface; by determining the target log object to be subjected to log level adjustment according to the class name information, the log level of the log object in a certain class can be adjusted more accurately, and compared with the packet level adjustment of an activator component, the granularity of the adjustment is finer and more accurate; by adjusting the current log level of the target log object to the target log level, the log level can be adjusted in real time according to the log level adjustment request, and convenience in adjusting the log level is improved.
Referring to fig. 4, fig. 4 is a schematic block diagram of a log level adjustment apparatus 1000 according to an embodiment of the present application, which is configured to perform the log level adjustment method described above. Wherein, the log level adjusting device can be configured in the server or the terminal.
As shown in fig. 4, the log level adjustment apparatus 1000 includes: an adjustment interface determining module 1001, an adjustment request receiving module 1002, a log information determining module 1003, and a log level adjusting module 1004.
The tuning interface determining module 1001 is configured to determine, when a target log annotation is detected, a log tuning interface according to the target log annotation.
An adjustment request receiving module 1002, configured to, if a call operation of the log adjustment interface is detected, obtain a log level adjustment request according to the call operation.
A log information determining module 1003, configured to determine, according to the log level adjustment request, a target log object and a target log level to be subjected to log level adjustment.
A log level adjustment module 1004, configured to adjust the current log level of the target log object to the target log level.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 5.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present disclosure.
Referring to fig. 5, the computer device includes a processor and a memory connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by a processor, causes the processor to perform any of the log level adjustment methods.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
when a target log annotation is detected, determining a log adjustment interface according to the target log annotation; if the call operation of the log adjustment interface is detected, acquiring a log level adjustment request according to the call operation; determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request; and adjusting the current log level of the target log object to the target log level.
In one embodiment, the processor, when implementing determining a log reconciliation interface from the target log annotation, is configured to implement:
determining a target import selector corresponding to the target log annotation, and acquiring control object information corresponding to the target import selector; instantiating the control object information to obtain a control object corresponding to the control object information; and determining the log adjustment interface according to the control object.
In one embodiment, the processor, when implementing the target import selector that determines the target log annotation corresponds to, is configured to implement:
analyzing the target log annotation to obtain a target annotation value corresponding to the target log annotation; and determining the target import selector according to the target annotation value based on the corresponding relation between the preset annotation value and the import selector.
In one embodiment, when implementing obtaining the control object information corresponding to the target import selector, the processor is configured to implement:
analyzing the target import selector to obtain configuration information corresponding to the target import selector; and determining the control object information according to the configuration information.
In one embodiment, the processor, after implementing determining the log adjustment interface according to the control object, is further configured to implement:
acquiring a context environment object in an application program; adding the control object to the context environment object to update the context environment object, wherein updating the context environment object comprises adding the log adjustment interface to a preset application program interface list.
In one embodiment, the log level adjustment request includes class name information and log level information; when determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request, the processor is configured to:
determining the target log object to be subjected to log level adjustment according to the class name information; and determining the target log level according to the log level information.
In one embodiment, when the processor determines the target log object to be log level adjusted according to the class name information, the processor is configured to:
acquiring a log context environment object; determining the target class in the log context environment object according to the class name information; and determining the target log object according to the log object in the target class.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions, and the processor executes the program instructions to implement any log level adjustment method provided in the embodiment of the present application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital Card (SD Card), a Flash memory Card (Flash Card), and the like provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A log level adjustment method, comprising:
when a target log annotation is detected, determining a log adjustment interface according to the target log annotation;
if the call operation of the log adjustment interface is detected, acquiring a log level adjustment request according to the call operation;
determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request;
and adjusting the current log level of the target log object to the target log level.
2. The log-level reconciliation method of claim 1 wherein determining a log reconciliation interface from the target log annotation comprises:
determining a target import selector corresponding to the target log annotation, and acquiring control object information corresponding to the target import selector;
instantiating the control object information to obtain a control object corresponding to the control object information;
and determining the log adjustment interface according to the control object.
3. The log level adjustment method of claim 2, wherein said determining a target import selector corresponding to the target log annotation comprises:
analyzing the target log annotation to obtain a target annotation value corresponding to the target log annotation;
and determining the target import selector according to the target annotation value based on the corresponding relation between the preset annotation value and the import selector.
4. The log level adjustment method according to claim 2, wherein the obtaining of the control object information corresponding to the target import selector includes:
analyzing the target import selector to obtain configuration information corresponding to the target import selector;
and determining the control object information according to the configuration information.
5. The log-level adjustment method of claim 2, wherein after determining the log adjustment interface according to the control object, further comprising:
acquiring a context environment object in an application program;
adding the control object to the context environment object to update the context environment object, wherein updating the context environment object comprises adding the log adjustment interface to a preset application program interface list.
6. The log-level adjustment method of claim 1, wherein the log-level adjustment request includes class name information and log-level information;
the determining a target log object and a target log level to be subjected to log level adjustment according to the log level adjustment request includes:
determining the target log object to be subjected to log level adjustment according to the class name information;
and determining the target log level according to the log level information.
7. The method according to claim 6, wherein the determining the target log object to be log-level-adjusted according to the class name information comprises:
acquiring a log context environment object;
determining the target class in the log context environment object according to the class name information;
and determining the target log object according to the log object in the target class.
8. A log level adjustment apparatus, comprising:
the adjusting interface determining module is used for determining a log adjusting interface according to the target log annotation when the target log annotation is detected;
the adjustment request receiving module is used for acquiring a log level adjustment request according to the calling operation if the calling operation of the log adjustment interface is detected;
the log information determining module is used for determining a target log object to be subjected to log level adjustment and a target log level according to the log level adjustment request;
and the log level adjusting module is used for adjusting the current log level of the target log object to the target log level.
9. A computer device, wherein the computer device comprises a memory and a processor;
the memory for storing a computer program;
the processor for executing the computer program and implementing the log level adjustment method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the log level adjustment method according to any one of claims 1 to 7.
CN202110595198.2A 2021-05-28 2021-05-28 Log level adjusting method and device, computer equipment and storage medium Pending CN113204533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110595198.2A CN113204533A (en) 2021-05-28 2021-05-28 Log level adjusting method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110595198.2A CN113204533A (en) 2021-05-28 2021-05-28 Log level adjusting method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113204533A true CN113204533A (en) 2021-08-03

Family

ID=77023787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110595198.2A Pending CN113204533A (en) 2021-05-28 2021-05-28 Log level adjusting method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113204533A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023216042A1 (en) * 2022-05-08 2023-11-16 Oppo广东移动通信有限公司 Event management method and apparatus, device, storage medium, and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140149576A1 (en) * 2012-11-29 2014-05-29 Vladimir Pavlov Managing Application Log Levels in Cloud Environment
CN105843822A (en) * 2015-01-16 2016-08-10 北京神州泰岳软件股份有限公司 Method and device for changing log levels
CN109032881A (en) * 2017-06-09 2018-12-18 武汉斗鱼网络科技有限公司 A kind of log level dynamic method of adjustment and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140149576A1 (en) * 2012-11-29 2014-05-29 Vladimir Pavlov Managing Application Log Levels in Cloud Environment
CN105843822A (en) * 2015-01-16 2016-08-10 北京神州泰岳软件股份有限公司 Method and device for changing log levels
CN109032881A (en) * 2017-06-09 2018-12-18 武汉斗鱼网络科技有限公司 A kind of log level dynamic method of adjustment and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023216042A1 (en) * 2022-05-08 2023-11-16 Oppo广东移动通信有限公司 Event management method and apparatus, device, storage medium, and program product

Similar Documents

Publication Publication Date Title
CN110569035B (en) Code compiling method, device, equipment and storage medium of software development project
US8434065B2 (en) Method for enhancing functionality of an automated testing tool
US20110289499A1 (en) Techniques to automatically update software applications
US8171348B2 (en) Data consistency in long-running processes
US9804952B1 (en) Application debugging in a restricted container environment
US20060209328A1 (en) Systems and methods that facilitate selective enablement of a device driver feature(s) and/or application(s)
CN112799940B (en) Regression testing method, regression testing device, computer system and computer readable storage medium
CN110214314B (en) Operating system authentication
CN113778442A (en) System menu generating method, device, equipment and storage medium
CN115269544A (en) Database cluster upgrading method and device, electronic equipment and storage medium
US11489844B2 (en) On-the-fly creation of transient least privileged roles for serverless functions
CN113204533A (en) Log level adjusting method and device, computer equipment and storage medium
CN113094048A (en) Data display rule determining method, display method, device, equipment and medium
CN116755677A (en) Atomic service arrangement method, device, equipment and storage medium
CN117056904A (en) Application privacy compliance judging method, device, computer equipment and medium
CN115086047B (en) Interface authentication method and device, electronic equipment and storage medium
CN113867778B (en) Image file generation method and device, electronic equipment and storage medium
CN111652580B (en) Method and device for processing data of nodes
US20140201839A1 (en) Identification and alerting of network devices requiring special handling maintenance procedures
CN112506590A (en) Interface calling method and device and electronic equipment
CN114942801B (en) FSM-based application release task processing method and device and electronic equipment
US11949561B2 (en) Automated preventative controls in digital workflow
US11354138B1 (en) Optimizing plugin loading
CN116192784B (en) Message notification method, device and equipment based on broadcast robot
CN115587344A (en) Button authority control method, system, equipment and storage medium based on vue

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination