CN116501519A - Log management method and device, electronic equipment and storage medium - Google Patents

Log management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116501519A
CN116501519A CN202310701182.4A CN202310701182A CN116501519A CN 116501519 A CN116501519 A CN 116501519A CN 202310701182 A CN202310701182 A CN 202310701182A CN 116501519 A CN116501519 A CN 116501519A
Authority
CN
China
Prior art keywords
log
service
micro
interface
receiving
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
CN202310701182.4A
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.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
China Southern Power Grid Digital Platform Technology Guangdong 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 China Southern Power Grid Digital Platform Technology Guangdong Co ltd filed Critical China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Priority to CN202310701182.4A priority Critical patent/CN116501519A/en
Publication of CN116501519A publication Critical patent/CN116501519A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/547Remote procedure calls [RPC]; Web services
    • 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
    • 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)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a log management method, a log management device, electronic equipment and a storage medium. The method is applied to a log management service, wherein a log receiving interface is predefined on the log management service, and the method comprises the following steps: receiving an interface calling instruction sent by any micro-service in at least one micro-service; responding to the interface call instruction, taking a micro-service which sends out the interface call instruction in the at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through the log receiving interface; sending the audit log to a target database so that the target database stores the audit log; wherein the at least one micro-service is a micro-service that can invoke the log receiving interface, which complies with the feign interface specification. The technical scheme of the embodiment of the invention can realize unified management of the audit logs of the multi-microservices.

Description

Log management method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer application, in particular to a log management method, a log management device, electronic equipment and a storage medium.
Background
Nowadays, the new version of the mobile application platform is subjected to micro-service transformation, so that the service flexibility is high, and the development and maintenance are more convenient.
At present, basic public data such as an audit log cannot be uniformly processed, for example, the audit log is managed by a micro-service, but the audit log can be more complicated in checking process and is knocked to be solved.
Disclosure of Invention
The embodiment of the invention provides a log management method, a log management device, electronic equipment and a storage medium, which are used for realizing unified management of audit logs of multiple micro-services.
According to an aspect of the present invention, there is provided a log management method applied to a log management service, on which a log receiving interface is predefined, which may include:
receiving an interface calling instruction sent by any micro-service in at least one micro-service;
responding to the interface call instruction, taking the micro-service which sends out the interface call instruction in at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through a log receiving interface;
sending the audit log to a target database so that the target database stores the audit log;
wherein, at least one micro-service is a micro-service capable of calling a log receiving interface, and the log receiving interface conforms to the feign interface specification.
According to another aspect of the present invention, there is provided a log management device configured in a log management service, on which a log receiving interface is predefined, which may include:
the interface calling instruction receiving module is used for receiving an interface calling instruction sent by any micro service in at least one micro service;
the audit log receiving module is used for responding to the interface calling instruction, taking the micro-service which sends out the interface calling instruction in at least one micro-service as a target micro-service, and receiving the audit log sent by the target micro-service through the log receiving interface;
the audit log sending module is used for sending the audit log to the target database so as to enable the target database to store the audit log;
wherein, at least one micro-service is a micro-service capable of calling a log receiving interface, and the log receiving interface conforms to the feign interface specification.
According to another aspect of the present invention, there is provided an electronic device, which may include:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to cause the at least one processor to implement the log management method provided by any embodiment of the present invention when executed.
According to another aspect of the present invention, there is provided a computer-readable storage medium having stored thereon computer instructions for causing a processor to implement the log management method provided by any embodiment of the present invention when executed.
According to the technical scheme, an interface calling instruction sent by any micro-service in at least one micro-service is received; responding to the interface call instruction, taking the micro-service which sends out the interface call instruction in at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through a log receiving interface; sending the audit log to a target database so that the target database stores the audit log; wherein, at least one micro-service is a micro-service capable of calling a log receiving interface, and the log receiving interface conforms to the feign interface specification. According to the technical scheme, the audit log sent by the target micro-service in at least one micro-service can be received based on the log receiving interface conforming to the feign interface specification on the log management service, so that unified management of the audit log of multiple micro-services based on the log management service can be realized.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention, nor is it intended to be used to limit the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
FIG. 1 is a flow chart of a log management method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a log management method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of an alternative example of a log management method according to the second embodiment of the present invention;
fig. 4 is a block diagram showing the construction of a log management apparatus provided in the third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing a log management method according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. The cases of "target", "original", etc. are similar and will not be described in detail herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a log management method according to a first embodiment of the present invention. The present embodiment is applicable to the case of log management. The method is applied to log management service, a log receiving interface is predefined on the log management service, the log receiving interface can be executed by the log management device provided by the embodiment of the invention, the device can be realized by software and/or hardware, the device can be integrated on electronic equipment, and the electronic equipment can be various user terminals or servers.
Referring to fig. 1, the method of the embodiment of the present invention specifically includes the following steps:
s110, receiving an interface calling instruction sent by any micro-service in at least one micro-service.
Wherein, the log management service may be understood as a service for managing audit logs; a log receiving interface conforming to the feign interface specification may be predefined on the log management service in advance. The log receiving interface can be understood as an interface for receiving audit logs that complies with the feign interface specification; the log receiving interface may be, for example, a representational state transfer (representational state transfer, REST) interface. The micro-service may be a micro-service in a mobile application platform.
It should be noted that the log management service may be a service using a spring group micro-service framework, and the log management service may be introduced into a condul registry integration component; annotations enabled into the condul registry and feign may be configured at the start of the log management service.
In the embodiment of the invention, the number of micro-services which are required to perform audit log unified management may be at least one, and when any one of the at least one micro-service is required to store the audit log, an interface calling instruction may be sent, where the interface calling instruction is an instruction for indicating a log receiving interface for calling the log management service.
In the embodiment of the invention, when the micro service stores the audit log in any micro service requirement in at least one micro service, the micro service and the log management service uniformly use a condul registry to acquire information related to the address of the log management service or the log receiving interface, and any micro service sends an interface calling instruction to the address indicated by the information related to the address based on the information related to the address.
It should be noted that the log management service may simultaneously accept interface call instructions issued by any of the plurality of micro services in the at least one micro service, so as to simultaneously receive audit logs sent by the plurality of micro services.
It should be noted that, the interface call instruction issued by any micro-service in the at least one micro-service may also be issued in a manner of requesting an interface call request for calling the interface. The interface call instruction or the interface call request and the service name or address of the log management service of the log receiving interface called by the requirement can represent the field or parameter of the identity of the log receiving interface, and the requirement is consistent with the field or parameter defined or registered when the log receiving interface is defined.
S120, responding to the interface call instruction, taking the micro-service which sends out the interface call instruction in at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through a log receiving interface, wherein the at least one micro-service is the micro-service which can call the log receiving interface, and the log receiving interface conforms to the feign interface specification.
The target micro-service is a micro-service which sends out an interface calling instruction in at least one micro-service. Audit logs may be understood as logs related to operational behavior in a microservice; the audit log may include, for example, various types of logs of microservice security events, user access records, microservice operational logs, microservice operational status, and/or administrator operational logs.
It should be noted that, the Feign is a declarative and templated hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) client provided by the Spring Cloud, the Feign can make the process of calling the remote service simpler, only an interface needs to be created and added with comments, and the Feign integrates the rib by default, so that the Fegin can realize the effect of load balancing by default, therefore, in the embodiment of the invention, the log receiving interface can follow the Feign interface specification.
In the embodiment of the invention, at least one micro-service can be an interface which can conform to the feign interface specification, or can call the micro-service of the log receiving interface based on the modes of hypertext transfer protocol and the like, and the log receiving interface conforms to the feign interface specification.
Optionally, the log receiving interface supports receiving an interface call instruction sent based on a hypertext transfer protocol mode. Specifically, the log receiving interface may simultaneously follow the feign interface specification, and support to receive an interface call instruction sent based on the hypertext transfer protocol, so that, when the target micro service sends the interface call instruction in the hypertext transfer protocol based manner, or sends the interface call instruction through the interface following the feign interface specification, the audit log sent by the target micro service may be received through the log receiving interface.
S130, sending the audit log to a target database so that the target database stores the audit log.
The target database may be understood as a database into which audit logs are required to be stored.
In the embodiment of the invention, the audit log can be sent to a unified target database so that the target database stores the audit log; and splitting the audit log according to the type of the target microservice for sending the audit log and/or the audit log under the condition that the number of the target databases is multiple, and sending at least one split log obtained after splitting to the target databases which are required to be stored corresponding to the split log so that the multiple target databases can store the split log respectively.
In the embodiment of the invention, the audit log can be sent to the storage space such as the hard disk, so that the storage space such as the hard disk stores the audit log.
According to the technical scheme, an interface calling instruction sent by any micro-service in at least one micro-service is received; responding to the interface call instruction, taking the micro-service which sends out the interface call instruction in at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through a log receiving interface; sending the audit log to a target database so that the target database stores the audit log; wherein, at least one micro-service is a micro-service capable of calling a log receiving interface, and the log receiving interface conforms to the feign interface specification. According to the technical scheme, the audit log sent by the target micro-service in at least one micro-service can be received based on the log receiving interface conforming to the feign interface specification on the log management service, so that unified management of the audit log of multiple micro-services based on the log management service can be realized.
An optional technical scheme is that a log sending interface is predefined on a target micro-service; receiving an audit log sent by a target micro-service through a log receiving interface, wherein the audit log comprises: receiving an audit log sent by a target micro-service through a log sending interface through a log receiving interface; wherein, the log sending interface is added with feign annotation corresponding to feign interface specification.
The log sending interface can be understood as an interface on the target micro-service, which can send an audit log.
In the embodiment of the invention, the annotation for starting the condul registry and the feign can be configured when the target micro-service is started, the target micro-service can be pre-defined with a log sending interface, the log sending interface is configured with a calling mode of the feign interface, the feign annotation corresponding to the feign interface specification is added to the log sending interface, and the condul registry is uniformly used by the log sending interface and the log receiving interface; the log management service can receive the audit log sent by the target micro-service through the log sending interface through the log receiving interface. In the embodiment of the invention, the audit logs can be transmitted through the log transmitting interface and the log receiving interface conforming to the feign interface specifications, so that unified management of the audit logs of the multi-microservices based on the log management service is further realized.
In another alternative solution, the sending the audit log to the target database to enable the target database to store the audit log includes: and sending the audit log to a target database so that the target database stores the audit log according to the target micro-service and/or the log type of the audit log.
The log type may be understood as a type of audit log, and may be, for example, a micro-service security event, a user access record, a micro-service running log, a micro-service running state, and/or an administrator operation log.
In the embodiment of the invention, the audit log can be sent to the target database, so that the target database stores the audit log in a partitioning or slicing mode according to the name, the label, the type and the like of the target micro-service for sending the audit log and/or the log type of the audit log.
In the embodiment of the invention, the audit log can also be stored according to the target micro-service, the log type of the audit log, the user who generates the audit log, and/or an administrator who operates to generate the audit log, and the like. For example, if the audit log is an administrator operations log for b-administrators operating on the A-microservices, the audit log may be stored in a storage partition in the target database that corresponds to b-administrators operating on the A-microservices.
In the embodiment of the invention, the audit log is sent to the target database, so that the target database stores the audit log according to the target micro-service and/or the log type of the audit log. In the embodiment of the invention, more detailed unified storage management can be performed on the audit log.
In another alternative technical scheme, an asynchronous thread pool is preconfigured on the log management service; receiving an audit log sent by a target micro-service through a log receiving interface, wherein the audit log comprises: and receiving an audit log sent by the target micro-service by adopting an asynchronous thread in an idle state in the asynchronous thread pool through a log receiving interface.
In the embodiment of the invention, an asynchronous thread pool is preconfigured on a log management service, for example, the asynchronous thread pool can be a spring asynchronous thread pool; the log management service can receive the audit log sent by the target micro-service through the log receiving interface by adopting an asynchronous thread in an idle state in the asynchronous thread pool. In the embodiment of the invention, the multi-micro service can send the audit log to the log management service simultaneously through the asynchronous thread pool, so that the efficiency of receiving the audit log and the timeliness of receiving the audit log by newspapers are improved.
Example two
Fig. 2 is a flowchart of another log management method according to the second embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, the method further includes: responding to the log checking instruction, and acquiring a log to be checked from a target database according to log information corresponding to the log checking instruction; and displaying the log to be checked. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 2, the method of this embodiment may specifically include the following steps:
s210, receiving an interface calling instruction sent by any micro-service in at least one micro-service.
S220, responding to the interface call instruction, taking the micro-service which sends out the interface call instruction in at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through a log receiving interface, wherein the at least one micro-service is the micro-service which can call the log receiving interface, and the log receiving interface conforms to the feign interface specification.
And S230, sending the audit log to a target database so that the target database stores the audit log.
S240, responding to the log checking instruction, and acquiring the log to be checked from the target database according to the log information corresponding to the log checking instruction.
The log view instruction may be understood as an instruction indicating that the log to be viewed is viewed. The log information can be understood as information related to logs to be checked which need to be checked; the log information may include, for example, a micro-service to be viewed, a type to be viewed, a user to be viewed, and/or an administrator to be viewed, and so forth. The log to be viewed may be understood as an audit log to be viewed. The micro-service to be viewed can be understood as the micro-service corresponding to the log to be viewed. The to-be-viewed type can be understood as a log type corresponding to the to-be-viewed log. The user to be checked can be understood as the user corresponding to the log to be checked, which causes the log to be checked. The to-be-viewed manager can be understood as an administrator generating the to-be-viewed log by the operation corresponding to the to-be-viewed log.
In the embodiment of the invention, the log to be checked can be obtained from the audit log stored in the target database according to the log information corresponding to the log checking instruction in response to the log checking instruction, for example, the log information comprises the micro-service to be checked and the user to be checked, and the log to be checked which is generated by the micro-service to be checked and belongs to the user to be checked and is generated by the micro-service to be checked can be obtained from the audit log stored in the target database according to the micro-service to be checked and the user to be checked.
S250, displaying the log to be checked.
In the embodiment of the invention, the log to be checked can be displayed, for example, the log to be checked can be displayed on a display platform of the log management service. In the embodiment of the present invention, the manner of displaying the log to be checked is not particularly limited.
In the embodiment of the invention, the log management service can provide a log display page, or a management background connected with the log management service can provide the log display page, for example, audit logs of micro services of different modules can be queried through the log display page and/or audit logs obtained according to user operation of different time periods, and the like. In the embodiment of the invention, the display form for displaying the log to be checked is not particularly limited.
According to the technical scheme, the log to be checked is obtained from the target database according to the log information corresponding to the log checking instruction in response to the log checking instruction; and displaying the log to be checked. In the embodiment of the invention, the log to be checked, which needs to be checked, can be displayed.
An optional technical scheme includes that log information comprises micro services to be checked and types to be checked, wherein the micro services to be checked belong to at least one micro service; according to the log information corresponding to the log checking instruction, acquiring the log to be checked from the target database, wherein the log checking instruction comprises the following steps: and obtaining the to-be-checked logs belonging to the to-be-checked type generated by the to-be-checked micro-service from the target database according to the to-be-checked micro-service and the to-be-checked type corresponding to the log checking instruction.
In the embodiment of the invention, the log information can comprise a micro-service to be checked and a type to be checked, wherein the micro-service to be checked belongs to at least one micro-service; according to the micro-service to be checked and the type to be checked corresponding to the log checking instruction, the log to be checked which is generated by the micro-service to be checked and belongs to the type to be checked can be acquired from the audit log stored in the target database. In the embodiment of the invention, more accurate searching of the logs to be checked which need to be checked can be realized.
For better understanding of the technical solution of the embodiment of the present invention described above, an alternative example is provided herein. Illustratively, referring to FIG. 3, the log management service defines a log receiving interface; sending an audit log by the micro-service call log receiving interface; the log management service acquires an audit log and sends the audit log to a target database; and responding to the log viewing instruction, and displaying the log to be viewed.
Example III
Fig. 4 is a block diagram of a log management device according to a third embodiment of the present invention, where the device is configured in a log management service, and a log receiving interface is predefined on the log management service, and the device is configured to execute the log management method according to any of the foregoing embodiments. The device and the log management method of each embodiment belong to the same invention conception, and the details of the log management device, which are not described in detail in the embodiment of the log management device, can be referred to the embodiment of the log management method. Referring to fig. 4, the apparatus may specifically include: the interface calls the instruction receiving module 310, the audit log receiving module 320, and the audit log sending module 330.
The interface call instruction receiving module 310 is configured to receive an interface call instruction sent by any micro service in at least one micro service;
an audit log receiving module 320, configured to respond to the interface call instruction, take a micro service that issues the interface call instruction in at least one micro service as a target micro service, and receive, through a log receiving interface, an audit log sent by the target micro service;
the audit log sending module 330 is configured to send the audit log to the target database, so that the target database stores the audit log;
wherein, at least one micro-service is a micro-service capable of calling a log receiving interface, and the log receiving interface conforms to the feign interface specification.
Optionally, a log sending interface is predefined on the target micro-service;
the audit log receiving module 320 may include:
the audit log receiving unit is used for receiving the audit log sent by the target micro-service through the log sending interface through the log receiving interface;
wherein, the log sending interface is added with feign annotation corresponding to feign interface specification.
Optionally, the audit log sending module 330 may include:
and the audit log sending unit is used for sending the audit log to the target database so that the target database stores the audit log according to the target micro-service and/or the log type of the audit log.
Optionally, an asynchronous thread pool is preconfigured on the log management service;
the audit log receiving module 320 may include:
and the audit log receiving unit is used for receiving the audit log sent by the target micro-service by adopting an asynchronous thread in an idle state in the asynchronous thread pool through the log receiving interface.
Optionally, the log management device may further include:
the to-be-checked log obtaining module is used for responding to the log checking instruction and obtaining the to-be-checked log from the target database according to the log information corresponding to the log checking instruction;
and the log to be checked display module is used for displaying the log to be checked.
On the basis of the scheme, optionally, the log information comprises micro services to be checked and types to be checked, wherein the micro services to be checked belong to at least one micro service;
the log obtaining module to be checked can comprise:
the to-be-checked log obtaining unit is used for obtaining to-be-checked logs which are generated by the to-be-checked micro-services and are affiliated to the to-be-checked type from the target database according to the to-be-checked micro-services and the to-be-checked type corresponding to the log checking instruction.
Optionally, the log receiving interface supports receiving an interface call instruction sent based on a hypertext transfer protocol mode.
According to the log management device provided by the third embodiment of the invention, the interface calling instruction sent by any micro-service in at least one micro-service is received through the interface calling instruction receiving module; responding to the interface call instruction through an audit log receiving module, taking the micro-service which sends out the interface call instruction in at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through a log receiving interface; sending the audit log to a target database through an audit log sending module so that the target database stores the audit log; wherein, at least one micro-service is a micro-service capable of calling a log receiving interface, and the log receiving interface conforms to the feign interface specification. The device can receive the audit log sent by the target micro-service in at least one micro-service based on the log receiving interface conforming to the feign interface specification on the log management service, thereby realizing unified management of the audit log of multiple micro-services based on the log management service.
The log management device provided by the embodiment of the invention can execute the log management method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the embodiment of the log management device, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Example IV
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as a log management method.
In some embodiments, the log management method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the log management method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the log management method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A log management method, applied to a log management service, the log management service having a log receiving interface predefined thereon, the method comprising:
receiving an interface calling instruction sent by any micro-service in at least one micro-service;
responding to the interface call instruction, taking a micro-service which sends out the interface call instruction in the at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through the log receiving interface;
sending the audit log to a target database so that the target database stores the audit log;
wherein the at least one micro-service is a micro-service that can invoke the log receiving interface, which complies with the feign interface specification.
2. The method of claim 1, wherein the target microservice has a predefined log send interface thereon;
the receiving, through the log receiving interface, the audit log sent by the target micro service includes:
receiving an audit log sent by the target micro-service through the log sending interface through the log receiving interface;
and the log sending interface is added with a feign annotation corresponding to the feign interface specification.
3. The method of claim 1, wherein the sending the audit log to a target database to cause the target database to store the audit log comprises:
and sending the audit log to a target database, so that the target database stores the audit log according to the target micro-service and/or the log type of the audit log.
4. The method of claim 1, wherein the log management service is pre-configured with an asynchronous thread pool;
the receiving, through the log receiving interface, the audit log sent by the target micro service includes:
and receiving an audit log sent by the target micro-service by adopting an asynchronous thread in an idle state in the asynchronous thread pool through the log receiving interface.
5. The method according to claim 1, characterized in that the method further comprises:
responding to a log checking instruction, and acquiring a log to be checked from the target database according to log information corresponding to the log checking instruction;
and displaying the log to be checked.
6. The method of claim 5, wherein the log information includes a micro-service to be viewed and a type to be viewed, the micro-service to be viewed belonging to the at least one micro-service;
the obtaining the log to be checked from the target database according to the log information corresponding to the log checking instruction includes:
and acquiring the to-be-checked logs which are generated by the to-be-checked micro-service and are affiliated to the to-be-checked type from the target database according to the to-be-checked micro-service and the to-be-checked type corresponding to the log checking instruction.
7. The method of claim 1, wherein the log receiving interface supports receiving interface call instructions sent based on a hypertext transfer protocol.
8. A log management device configured in a log management service, the log management service having a log receiving interface defined in advance, the device comprising:
the interface calling instruction receiving module is used for receiving an interface calling instruction sent by any micro service in at least one micro service;
the audit log receiving module is used for responding to the interface calling instruction, taking the micro-service which sends out the interface calling instruction in the at least one micro-service as a target micro-service, and receiving an audit log sent by the target micro-service through the log receiving interface;
the audit log sending module is used for sending the audit log to a target database so that the target database stores the audit log;
wherein the at least one micro-service is a micro-service that can invoke the log receiving interface, which complies with the feign interface specification.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to cause the at least one processor to perform the log management method of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the log management method of any one of claims 1-7 when executed.
CN202310701182.4A 2023-06-13 2023-06-13 Log management method and device, electronic equipment and storage medium Pending CN116501519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310701182.4A CN116501519A (en) 2023-06-13 2023-06-13 Log management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310701182.4A CN116501519A (en) 2023-06-13 2023-06-13 Log management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116501519A true CN116501519A (en) 2023-07-28

Family

ID=87318580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310701182.4A Pending CN116501519A (en) 2023-06-13 2023-06-13 Log management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116501519A (en)

Similar Documents

Publication Publication Date Title
US11561972B2 (en) Query conversion for querying disparate data sources
CN113839977A (en) Message pushing method and device, computer equipment and storage medium
CN111125057B (en) Method and device for processing service request and computer system
CN110728498A (en) Information interaction method and device
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN114153703A (en) Micro-service exception positioning method and device, electronic equipment and program product
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
CN116450622B (en) Method, apparatus, device and computer readable medium for data warehouse entry
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN111274104B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN116501519A (en) Log management method and device, electronic equipment and storage medium
CN115291973A (en) Method and device for connecting database by application on cloud, electronic equipment and storage medium
US11277300B2 (en) Method and apparatus for outputting information
CN113434572A (en) Data query method, query system, device, storage medium and program product
CN114201508A (en) Data processing method, data processing apparatus, electronic device, and storage medium
CN113282455A (en) Monitoring processing method and device
CN113556370A (en) Service calling method and device
CN110768855B (en) Method and device for testing linkmzation performance
CN112099841A (en) Method and system for generating configuration file
CN113760886B (en) Method, apparatus, device and computer readable medium for providing data service
CN115987782B (en) Cloud hostname generation method, device, equipment, storage medium and program product
CN113766437B (en) Short message sending method and device
CN112084003B (en) Method, device, medium and electronic equipment for isolating data
US20240134723A1 (en) Technology and protocol agnostic key-value pair based user interface and data rendering to support a transaction

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