CN111966519A - Method, device and equipment for adjusting log level and readable medium - Google Patents

Method, device and equipment for adjusting log level and readable medium Download PDF

Info

Publication number
CN111966519A
CN111966519A CN202010788683.7A CN202010788683A CN111966519A CN 111966519 A CN111966519 A CN 111966519A CN 202010788683 A CN202010788683 A CN 202010788683A CN 111966519 A CN111966519 A CN 111966519A
Authority
CN
China
Prior art keywords
log
target component
component
log level
adjusting
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.)
Granted
Application number
CN202010788683.7A
Other languages
Chinese (zh)
Other versions
CN111966519B (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010788683.7A priority Critical patent/CN111966519B/en
Publication of CN111966519A publication Critical patent/CN111966519A/en
Priority to PCT/CN2021/096402 priority patent/WO2022028058A1/en
Application granted granted Critical
Publication of CN111966519B publication Critical patent/CN111966519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Multimedia (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for adjusting log level, which comprises the following steps: judging whether the target assembly has an REST interface; if the target component is provided with the REST interface, request information containing the target component and the adjustment mode is sent to the middleware; and acquiring the log level parameter in the target component through the middleware, and setting the log level parameter based on the adjustment mode. The invention also discloses a device for adjusting the log level, computer equipment and a readable storage medium. The method and the device have the advantages that the middleware is arranged on the component with the REST interface, the component without the REST interface is broadcasted, the log level of the component is dynamically modified under the condition that the related process of the component is not restarted, when the cloud platform operates abnormally, the debug function of the component can be dynamically opened, more log information is provided, problem troubleshooting is facilitated, and the method and the device are particularly important under the conditions that the component is relatively dangerous to restart, the production environment is high, or the component is not well restarted.

Description

Method, device and equipment for adjusting log level and readable medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a readable medium for adjusting a log level.
Background
Openstack (open source cloud computing platform management platform project) is a huge project, and the functions of all components are complex. When unexpected results occur in the operation process, in many cases, it is difficult to determine where the problem is, by only simple error reporting information, how to solve or avoid the problem is unknown, and some error reporting information is not even available.
When a problem needs to be eliminated and more information of system operation needs to be obtained, an effective scheme is to open the debug function of openstack related components, print more logs and obtain information to solve the problem. But currently, the log level of each component of openstack is set when starting, and is generally an info level. To adjust to debug level, only the configuration can be modified and the components restarted. And the problem is solved, and the configuration needs to be changed and the component needs to be restarted.
However, some problems may depend on the running time, or the problems can not be stably reproduced after some operations are run, and the problems can be difficult to reproduce once the process is restarted. In some client production environments, the restart process is not allowed or a complicated application flow is required, which makes it difficult or time-consuming to open the debug. After debug is opened, the debug needs to be turned off after the problem is solved, and excessive information is printed all the time without turning off, so that the debug is not beneficial to monitoring.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, an apparatus, a device, and a readable medium for adjusting a log level, where the method includes setting a middleware to an assembly with an REST interface, broadcasting the assembly without the REST interface, and dynamically modifying the log level of the assembly without restarting a related process of the assembly, and when a cloud platform is abnormal in operation, the method can implement a dynamic debug function of the assembly, provide more log information, facilitate problem troubleshooting, and is particularly important in a case where the assembly is dangerous to restart, a production environment, or a restart is not well repeated.
Based on the above object, an aspect of the embodiments of the present invention provides a method for adjusting a log level, including the following steps: judging whether the target assembly has an REST interface; if the target component is provided with the REST interface, request information containing the target component and the adjustment mode is sent to the middleware; and acquiring the log level parameter in the target component through the middleware, and setting the log level parameter based on the adjustment mode.
In some embodiments, setting the log-level parameter based on the adjustment mode comprises: if the adjustment mode is one-time adjustment, setting the log level parameter as an adjustment value; in response to the log completing printing, the log level parameter is reset to a default value.
In some embodiments, sending the request information including the target component and the adjustment mode to the middleware further comprises: prepositioning reverse proxy service and adding a target component and an adjustment mode in the configuration of the reverse proxy service;
obtaining, by the middleware, a log level parameter in the target component, and setting the log level parameter based on the adjustment mode includes: and acquiring the log level parameter in the target component through the reverse proxy service, and setting the log level parameter based on the adjustment mode.
In some embodiments, further comprising: and in response to the completion of the printing of the log, deleting the added content in the configuration of the reverse proxy service and restarting the reverse proxy service to set the log level as a default level.
In some embodiments, further comprising: if the target component does not have the REST interface, generating a broadcast message containing a target component list and a corresponding log level based on the target component, and sending the broadcast message to all components; each component receives the broadcast message and judges whether the broadcast message is in a target component list or not; and if the component is in the target component list, adjusting the log level according to the broadcast message.
In some embodiments, further comprising: updating and sending broadcast messages to all components in response to the completion of printing of the log; and if the component is in the target component list, adjusting the log level to a default level according to the broadcast message.
In some embodiments, the component includes in the target component list: if the target component list is none or all, all components are considered target components.
In another aspect of the embodiments of the present invention, an apparatus for adjusting a log level is further provided, including: the judging module is configured for judging whether the target assembly has an REST interface; the first processing module is configured to send request information containing the target component and the adjustment mode to the middleware if the target component has the REST interface; and the first adjusting module is configured to acquire the log level parameter in the target component through the middleware and set the log level parameter based on the adjusting mode.
In some embodiments, the first adjustment module is further configured to: if the adjustment mode is one-time adjustment, setting the log level parameter as an adjustment value; in response to the log completing printing, the log level parameter is reset to a default value.
In some embodiments, the first processing module is further configured to: if the target component is provided with an REST interface, the reverse proxy service is preposed, and the target component and the adjustment mode are added in the configuration of the reverse proxy service; the first adjustment module is further configured to: and acquiring the log level parameter in the target component through the reverse proxy service, and setting the log level parameter based on the adjustment mode.
In some embodiments, the first adjustment module is further configured to: and in response to the completion of the printing of the log, deleting the added content in the configuration of the reverse proxy service and restarting the reverse proxy service to set the log level as a default level.
In some embodiments, the apparatus further comprises a second processing module configured to: if the target component does not have the REST interface, generating a broadcast message containing a target component list and a corresponding log level based on the target component, and sending the broadcast message to all components; a second adjustment module configured to: each component receives the broadcast message and judges whether the broadcast message is in a target component list or not; and if the component is in the target component list, adjusting the log level according to the broadcast message.
In some embodiments, the second adjustment module is further configured to: updating and sending broadcast messages to all components in response to the completion of printing of the log; and if the component is in the target component list, adjusting the log level to a default level according to the broadcast message.
In some embodiments, the second adjustment module is further configured to: if the target component list is none or all, all components are considered target components.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: the method has the advantages that the middleware is arranged on the component with the REST interface, the component without the REST interface is broadcasted, the log level of the component is dynamically modified under the condition that the related process of the component is not restarted, when the cloud platform operates abnormally, the debug function of the component can be dynamically opened, more log information is provided, problem troubleshooting is facilitated, and the method is particularly important under the conditions that the component is dangerous to restart, the production environment is poor in restarting and the reappearance is poor.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a diagram illustrating an embodiment of a method for adjusting log levels according to the present invention;
FIG. 2 is a diagram of an embodiment of an apparatus for adjusting a log level according to the present invention;
FIG. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention;
FIG. 4 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above object, a first aspect of the embodiments of the present invention proposes an embodiment of a method for adjusting a log level. Fig. 1 is a schematic diagram illustrating an embodiment of a method for adjusting a log level provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, judging whether the target assembly has an REST interface;
s2, if the target component has the REST interface, sending request information containing the target component and the adjustment mode to the middleware; and
s3, obtaining the log level parameter in the target component through the middleware, and setting the log level parameter based on the adjustment mode.
In this embodiment, taking the cloud computing platform openstack as an example, the level of the log is info in general, and more log information will be printed after the level of the log is changed to debug. The various components in openstack communicate, mostly, through the REST API or message queue. I.e., the component already has the capability to receive API requests, or to listen to the message queue.
For components already provided with the capability of providing REST APIs. Because components of the REST API provided by openstack are all realized by adopting a WSGI framework protocol, a middleware is designed, after the middleware receives an API request, whether the Headers of the request contain X-Log-Level is checked, if the Headers contain the X-Log-Level, a current LOG object is obtained, and the current Log Level is set according to the value set in the request. When the log level is changed to debug, the debug can be set in the Header, and the log level of printing will be debug when all requests are executed subsequently. When it is desired to change back to info, info may be set in the Header.
In this embodiment, the REST API service of openstack combines each middleware and WSGI APP through the pass. The middleware can be added into the components of the openstack API through the state configuration to provide services. Middleware in openstack is a python library of oslo. And (4) reloading the process _ request, judging whether the request header contains X-Log-Level, and if not, directly not processing. If the one-time setting is included, judging whether the one-time setting is included, if the one-time setting is included, keeping the original log level, changing the log level, and if the one-time setting is not included, directly changing the log level. And (4) overloading the process _ response, judging whether the original log level is saved, if not, not processing, and if so, restoring the original log level.
In some embodiments of the invention, setting the log-level parameter based on the adjustment mode comprises: if the adjustment mode is one-time adjustment, setting the log level parameter as an adjustment value; in response to the log completing printing, the log level parameter is reset to a default value.
In this embodiment, a log level that only this request is valid may also be set. When only the request is required to be set to be effective, the X-Log-Level can be set to be once-debug, the middleware stores the current Log Level after receiving Header information, sets the Log Level to be debug, then carries out request processing, the logs in the request are all debug levels, and after the request processing is finished, the Log Level is set to be the original value.
In some embodiments of the invention, sending the request information including the target component and the adjustment mode to the middleware further comprises: the reverse proxy service is pre-positioned and target components and adjustment modes are added in the configuration of the reverse proxy service. Obtaining, by the middleware, a log level parameter in the target component, and setting the log level parameter based on the adjustment mode includes: and acquiring the log level parameter in the target component through the reverse proxy service, and setting the log level parameter based on the adjustment mode.
By adding middleware, the API providing component is provided with the function of dynamically adjusting the log level without restarting. But if the log level is required to be changed, the calling party is required to add a corresponding Header to adjust the log level. In order to make the operation simpler, in this embodiment, when a component providing the REST API service, a pre-reverse proxy service, needs to call the API, the reverse proxy service is called, and the reverse proxy service calls the corresponding component. Taking a service hash of a reverse proxy frequently used by openstack as an example, a Header http-request set-Header X-Log-Level once-debug can be added in the hash configuration, so that the Header can be automatically added without adding the Header by a calling party, the Log Level of a request API is changed into debug, and the Log Level of each request can be guaranteed to be debug. When the log level needs to be adjusted, only the haproxy configuration needs to be modified and the haproxy needs to be restarted, and the running process and the state of the openstack component are not influenced.
In some embodiments of the invention, further comprising: and in response to the completion of the printing of the log, deleting the added content in the configuration of the reverse proxy service and restarting the reverse proxy service to set the log level as a default level.
In this embodiment, when the default info needs to be used, the haproxy configuration file may be modified to delete the configuration just added, and then the haproxy is restarted. When the log level needs to be adjusted, only the haproxy configuration needs to be modified and the haproxy needs to be restarted, and the running process and the state of the openstack component are not influenced.
In some embodiments of the invention, further comprising: if the target component does not have the REST interface, generating a broadcast message containing a target component list and a corresponding log level based on the target component, and sending the broadcast message to all components; each component receives the broadcast message and judges whether the broadcast message is in a target component list or not; and if the component is in the target component list, adjusting the log level according to the broadcast message.
In the embodiment, for a component with the capability of receiving a message in a message queue, a fanout type consumption theme t-log is added to the component, and an endpoint for processing the consumption theme adds a processing method set _ log _ level. set _ log _ level method, receiving parameters log _ level and components, the log _ level parameter referring to the log level to be set. Wherein, components refer to the effective component list, and None and all refer to all the effective components. When receiving the broadcasted log level message, judging whether the log level message is in the range of the effective component, and if not, not processing the log level message; and in the effective range, acquiring the current LOG object and setting the LOG level according to the setting required by the information content.
In the present embodiment, the component of neutron is taken as an example, and the scheme is adapted. For a neutron _ server, such a multi-process and different-purpose component. Newly designing a neutron plug. The plugin inherits the servicePluginBase class, and contains a method set _ log _ level, a receiving parameter log _ level, components. Adding start _ rpc _ listeners for enabling rpc worker process, adding registered consumers in the start _ rpc _ listeners method, monitoring topic ═ t-log, endpoint being current core plug, and switching on the fanout switch. And adding a method start _ rpc _ state _ reports _ descriptors for enabling rpc report worker process, and directly calling start _ rpc _ descriptors. Defining an RpcWorker in the init function of the plugin, wherein the RpcWorker is used for enabling a period worker process to work, the plugin of the RpcWorker is the RpcWorker, and then calling self. The adaptation scheme can realize that under the condition of not moving the neutron code, all processes related to the neutron server using rpc have the function of dynamically adjusting the log level, and whether the function is loaded or not can be determined according to the configuration file.
In the present embodiment, the adaptation scheme is performed by taking an Agent type component as an example. Such components are typically single processes. Taking neutron as an example, when many components are started by using its inherited class such as neutron _ lib, rpc, service or neutron-dhcp-agent neutron-l3-agent, a method set _ log _ level is added to the class, and parameters log _ level and components are received. And adding registered consumers in the start method, monitoring topic ═ t-log, and adding endpoint. These components can implement registration snoop log changes at startup. The core idea is that there is a unified base class to add registration in the accumulation. For components that are not a unified base class, reference may be made to an implementation. Because openstack implements the connect message queue using oslo _ message, the listen message queue.
In the embodiment, openstack common component oslo.config is used for parsing the command line, oslo.message is used for realizing the connection message queue, and the fanout type message is sent. The command line allows the input of the parameters: -config-file for receiving a configuration file path, the configuration file including address password information for connecting to the message queue; -topic specifies the exchange name of fanout, default t-log; components specify the active component, by default None, i.e. the component that listens to the message all. The middle parts of the components are connected by English commas; level specifies the log boundary to be set, allowing info debug error. Default to debug.
In some embodiments of the invention, further comprising: updating and sending broadcast messages to all components in response to the completion of printing of the log; and if the component is in the target component list, adjusting the log level to a default level according to the broadcast message.
In some embodiments of the invention, the component includes in the target component list: if the target component list is none or all, all components are considered target components.
It should be particularly noted that, the steps in the embodiments of the method for adjusting a log level can be mutually intersected, replaced, added, or deleted, and therefore, these methods for adjusting a log level that are reasonably transformed by permutation and combination also belong to the scope of the present invention, and the scope of the present invention should not be limited to the embodiments.
In view of the above object, according to a second aspect of the embodiments of the present invention, an apparatus for adjusting a log level is provided. Fig. 2 is a schematic diagram illustrating an embodiment of an apparatus for adjusting a log level according to the present invention. As shown in fig. 2, the embodiment of the present invention includes the following modules: a judging module S11 configured to judge whether the target component has a REST interface; a first processing module S12, configured to, if the target component has a REST interface, send request information including the target component and the adjustment mode to the middleware; and a first adjusting module S13 configured to obtain the log level parameter in the target component through the middleware and set the log level parameter based on the adjustment mode.
In some embodiments, the first adjusting module S13 is further configured to: if the adjustment mode is one-time adjustment, setting the log level parameter as an adjustment value; in response to the log completing printing, the log level parameter is reset to a default value.
In some embodiments, the first processing module is further configured to: if the target component is provided with an REST interface, the reverse proxy service is preposed, and the target component and the adjustment mode are added in the configuration of the reverse proxy service; the first adjustment module is further configured to: and acquiring the log level parameter in the target component through the reverse proxy service, and setting the log level parameter based on the adjustment mode.
In some embodiments, the first adjustment module is further configured to: and in response to the completion of the printing of the log, deleting the added content in the configuration of the reverse proxy service and restarting the reverse proxy service to set the log level as a default level.
In some embodiments, the apparatus further comprises a second processing module configured to: if the target component does not have the REST interface, generating a broadcast message containing a target component list and a corresponding log level based on the target component, and sending the broadcast message to all components; a second adjustment module configured to: each component receives the broadcast message and judges whether the broadcast message is in a target component list or not; and if the component is in the target component list, adjusting the log level according to the broadcast message.
In some embodiments, the second adjustment module is further configured to: updating and sending broadcast messages to all components in response to the completion of printing of the log; and if the component is in the target component list, adjusting the log level to a default level according to the broadcast message.
In some embodiments, the second adjustment module is further configured to: if the target component list is none or all, all components are considered target components.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the steps of the above method.
The invention also provides a computer readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer readable storage medium stores S31 a computer program that, when executed by a processor, performs the method as described above S32.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by a computer program to instruct related hardware, and the program of the method for adjusting the log level can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods as described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method of adjusting log levels, comprising the steps of:
judging whether the target assembly has an REST interface;
if the target component is provided with the REST interface, sending request information containing the target component and the adjustment mode to the middleware; and
and acquiring a log level parameter in the target component through the middleware, and setting the log level parameter based on the adjustment mode.
2. The method of adjusting a log level of claim 1, wherein setting the log level parameter based on the adjustment mode comprises:
if the adjustment mode is one-time adjustment, setting the log level parameter as an adjustment value;
resetting the journal level parameter to a default value in response to the journal completing printing.
3. The method of adjusting log levels of claim 1, wherein sending request information containing the target component and an adjustment mode to a middleware further comprises: pre-staging a reverse proxy service and adding the target component and adjustment mode in a configuration of the reverse proxy service;
obtaining, by the middleware, a log level parameter in the target component, and setting the log level parameter based on the adjustment mode includes: and acquiring a log level parameter in the target component through the reverse proxy service, and setting the log level parameter based on the adjustment mode.
4. The method of adjusting log levels of claim 3, further comprising:
and in response to the completion of the printing of the log, deleting the content added in the configuration of the reverse proxy service and restarting the reverse proxy service so as to set the log level as a default level.
5. The method of adjusting log levels of claim 1, further comprising:
if the target component does not have the REST interface, generating a broadcast message containing a target component list and a corresponding log level based on the target component, and sending the broadcast message to all components;
each component receives the broadcast message and judges whether the broadcast message is in the target component list or not;
and if the component is in the target component list, adjusting the log level according to the broadcast message.
6. The method of adjusting log levels of claim 5, further comprising:
updating and sending a broadcast message to all components in response to the log completing printing;
and if the component is in the target component list, adjusting the log level to a default level according to the broadcast message.
7. The method of adjusting log levels of claim 5, wherein the component includes in the list of target components:
and if the target component list is a none or all, all the components are considered to be the target components.
8. An apparatus for adjusting log levels, comprising:
the judging module is configured for judging whether the target assembly has an REST interface;
the first processing module is configured to send request information containing the target component and the adjustment mode to the middleware if the target component has the REST interface; and
and the first adjusting module is configured to acquire the log level parameter in the target component through the middleware and set the log level parameter based on the adjusting mode.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202010788683.7A 2020-08-07 2020-08-07 Method, device, equipment and readable medium for adjusting log level Active CN111966519B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010788683.7A CN111966519B (en) 2020-08-07 2020-08-07 Method, device, equipment and readable medium for adjusting log level
PCT/CN2021/096402 WO2022028058A1 (en) 2020-08-07 2021-05-27 Method and apparatus for adjusting log level, device, and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010788683.7A CN111966519B (en) 2020-08-07 2020-08-07 Method, device, equipment and readable medium for adjusting log level

Publications (2)

Publication Number Publication Date
CN111966519A true CN111966519A (en) 2020-11-20
CN111966519B CN111966519B (en) 2023-06-06

Family

ID=73366185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010788683.7A Active CN111966519B (en) 2020-08-07 2020-08-07 Method, device, equipment and readable medium for adjusting log level

Country Status (2)

Country Link
CN (1) CN111966519B (en)
WO (1) WO2022028058A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022028058A1 (en) * 2020-08-07 2022-02-10 苏州浪潮智能科技有限公司 Method and apparatus for adjusting log level, device, and readable medium
CN114500281A (en) * 2022-01-13 2022-05-13 上海钧正网络科技有限公司 System, method and device for configuring mobile terminal

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111130905A (en) * 2019-12-31 2020-05-08 青梧桐有限责任公司 Distributed cluster-based log level dynamic adjustment method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8468391B2 (en) * 2010-08-04 2013-06-18 International Business Machines Corporation Utilizing log event ontology to deliver user role specific solutions for problem determination
CN103488558A (en) * 2013-09-17 2014-01-01 北京思特奇信息技术股份有限公司 Device and method of automatically acquiring application anomalies based on LOG4J logging framework
CN109992480A (en) * 2019-04-11 2019-07-09 苏州浪潮智能科技有限公司 A kind of log rank amending method, system and electronic equipment and storage medium
CN111475379A (en) * 2020-03-27 2020-07-31 苏州浪潮智能科技有限公司 Log processing method and device, electronic equipment and storage medium
CN111966519B (en) * 2020-08-07 2023-06-06 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for adjusting log level

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111130905A (en) * 2019-12-31 2020-05-08 青梧桐有限责任公司 Distributed cluster-based log level dynamic adjustment method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI_101357: "OpenStack设计与实现——RESTful API和WSGI", 《HTTPS://BLOG.CSDN.NET/LI_101357/ARTICLE/DETAILS/52746107》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022028058A1 (en) * 2020-08-07 2022-02-10 苏州浪潮智能科技有限公司 Method and apparatus for adjusting log level, device, and readable medium
CN114500281A (en) * 2022-01-13 2022-05-13 上海钧正网络科技有限公司 System, method and device for configuring mobile terminal

Also Published As

Publication number Publication date
WO2022028058A1 (en) 2022-02-10
CN111966519B (en) 2023-06-06

Similar Documents

Publication Publication Date Title
US11425225B2 (en) Method, apparatus, and equipment for exposing edge network capability, and storage medium
CN111756571B (en) Cluster node fault processing method, device, equipment and readable medium
CN108512903B (en) Abnormal information processing method and device, storage medium and API gateway
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN111966519A (en) Method, device and equipment for adjusting log level and readable medium
EP3709664A1 (en) Stream pushing method, system and server
US11102319B2 (en) Method, system and server for stream-pushing
CN111984561B (en) IPMI command processing method, system, device and medium for BMC
WO2021057605A1 (en) Device management method, device, system and device, and storage medium
CN111708834A (en) Method, system, equipment and medium for synchronizing service configuration data
US20210329098A1 (en) Methods of operating service instance sets and/or set restoration storage resources and related network nodes
CN115225493B (en) Configuration generation method and device of networking node based on wireless
CN111309691A (en) Data sharing exchange system and exchange method based on bus architecture
US11888688B2 (en) Configuration information subscription method and apparatus
US11785102B1 (en) Methods, systems, and computer readable media for application programming interface (API) related groupings involving common application programming interface framework
CN115499489A (en) Method, device, equipment and readable medium for managing sub-network in link
CN112491810B (en) Data connection method and mobile terminal
US11025773B1 (en) Virtual communication service for mobile devices
CN111478941B (en) Mock automatic operation method and device, computer equipment and storage medium
CN112306723B (en) Operation information acquisition method and device applied to applet
CN114025005A (en) Data communication method, system, electronic equipment and storage medium
US11709725B1 (en) Methods, systems, and computer readable media for health checking involving common application programming interface framework
CN111367757A (en) Message display method and device, electronic equipment and storage medium
US11765030B2 (en) Methods, systems, and computer readable media for registering application functions using common application programming interface framework
US20240057033A1 (en) Methods, systems, and computer readable media for avoiding sending of duplicate notifications for overlapping subscriptions at network function (nf) repository function (nrf)

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
GR01 Patent grant
GR01 Patent grant