CN114371888A - Method and device for hot updating of log collection plug-in, electronic equipment and readable medium - Google Patents
Method and device for hot updating of log collection plug-in, electronic equipment and readable medium Download PDFInfo
- Publication number
- CN114371888A CN114371888A CN202210044143.7A CN202210044143A CN114371888A CN 114371888 A CN114371888 A CN 114371888A CN 202210044143 A CN202210044143 A CN 202210044143A CN 114371888 A CN114371888 A CN 114371888A
- Authority
- CN
- China
- Prior art keywords
- log
- configuration file
- event
- plug
- specified
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000012544 monitoring process Methods 0.000 claims abstract description 28
- 238000007781 pre-processing Methods 0.000 claims description 7
- 238000001914 filtration Methods 0.000 claims description 5
- 238000010606 normalization Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000010195 expression analysis Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 244000038293 primary consumers Species 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The disclosure provides a hot updating method, a hot updating device, electronic equipment and a readable medium of a log collection plug-in, wherein the hot updating method of the log collection plug-in comprises the following steps: judging whether a monitoring example detects that a log configuration file generates a specified event or not, wherein the monitoring example is created aiming at the log configuration file of a log acquisition plug-in; and reloading the log configuration file according to the detected specified event, wherein the specified event comprises an event for editing the log configuration file and/or an event for closing the log configuration file. Through the embodiment of the disclosure, the hot update of the log collection plug-in is realized, and the fluency and the update efficiency of the log collection plug-in are improved.
Description
Technical Field
The disclosure relates to the technical field of log collection, in particular to a method and a device for hot updating of a log collection plug-in, electronic equipment and a readable medium.
Background
The primary consumer of logs was software engineers who examined the problem by reading the log, and today a large number of machines process the log data day and night to generate a readability report and make decisions on it.
The log collection technology is a program for delivering data from a source end to a destination end, the destination end is usually a centralized storage with a data subscription function, the purpose of this is to decouple log analysis and log storage, the same log may be interested by different consumers, the processing modes after the log is obtained may be different, after the data storage and the data analysis are decoupled, different consumers may subscribe the interested log, and a corresponding analysis tool is selected for analysis.
In the related art, the log collection technology is implemented by a log collection plug-in, for example, "fluent-bit" provides various log collection plug-ins to collect log files from different sources, such as collecting some measurement data from a log file collection and an operating system. When the Input plug-in is loaded, the "fluent-bit" creates an instance internally, each with its own independent configuration, which we usually refer to as its properties. The 'fluent-bit' is used as an open-source lightweight log processor and a repeater, so that the resource occupation is very small, and the log collection efficiency is higher.
However, the application of the "fluent-bit" has the disadvantage that the log configuration file is not supported for hot updating, once the log configuration file is modified, the log collection plug-in needs to be restarted, and the efficiency and the fluency of on-line log collection are seriously influenced by the plug-in.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a method, an apparatus, an electronic device, and a readable medium for hot-updating a log collection plug-in, which overcome, at least to some extent, the problem that the log collection plug-in does not support hot-updating due to the limitations and disadvantages of the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for hot update of a log collection plug-in, including: judging whether a monitoring example detects that the log configuration file generates a specified event or not, wherein the monitoring example is created aiming at the log configuration file of the log acquisition plug-in; and reloading the log configuration file according to the detected specified event, wherein the specified event comprises an event of editing the log configuration file and/or an event of closing the log configuration file.
In an exemplary embodiment of the present disclosure, further comprising: if the monitoring example is judged not to detect the specified event, polling is conducted to detect whether the log configuration file generates the specified event or not.
In an exemplary embodiment of the present disclosure, further comprising: creating a monitoring example aiming at the log configuration file of the log collection plug-in; and determining a file descriptor corresponding to the monitoring example, wherein the file descriptor is used for describing a specified file, and the specified file is used for storing events generated by the log configuration file.
In an exemplary embodiment of the present disclosure, reloading the log configuration file according to the detected specified event includes: if the specified event is judged to be detected, sending the specified event to an event queue of the specified file; traversing all events in the event queue; judging whether all events in the event queue contain the specified event or not; and if the specified event is detected, reloading the log configuration file.
In an exemplary embodiment of the present disclosure, further comprising: determining configuration information of the log acquisition plug-in, wherein the configuration information comprises at least one of a server IP, an acquisition object and a log storage path; and editing the log configuration file according to the configuration information.
In an exemplary embodiment of the present disclosure, further comprising: determining a log obtained by the log acquisition plug-in; analyzing the log according to a preset regular expression to extract attribute information of the log, wherein the attribute information comprises log generation time, log grade and log content; and merging the analyzed logs of multiple lines.
In an exemplary embodiment of the present disclosure, further comprising: preprocessing the log acquired by the log acquisition plug-in, wherein the preprocessing comprises at least one of input, filtering, normalization and standardization; and transmitting the preprocessed log to a middleware node in a specified format.
According to a second aspect of the embodiments of the present disclosure, there is provided a log collection plug-in hot update apparatus, including: the judging module is used for judging whether a monitoring example detects that the log configuration file generates a specified event or not, wherein the monitoring example is established aiming at the log configuration file of the log acquisition plug-in; and the loading module is used for reloading the log configuration file according to the detected specified event, wherein the specified event comprises an event for editing the log configuration file and/or an event for closing the log configuration file.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a memory; and a processor coupled to the memory, the processor configured to perform the method of any of the above based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a program which, when executed by a processor, implements a method for hot-updating of a log collection plug-in as described in any one of the above.
According to the embodiment of the disclosure, whether the monitoring example detects that the log configuration file generates the specified event is judged, and the log configuration file is reloaded according to the detected specified event, so that the log collection plug-in supports hot update, and the efficiency and the fluency of log collection are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 depicts a schematic diagram of an exemplary system architecture for a hot update scheme for a log collection plug-in to which embodiments of the present invention may be applied;
FIG. 2 is a flow chart of a method for hot-updating of a log collection plug-in an exemplary embodiment of the disclosure;
FIG. 3 is a flow chart of another method for hot-updating of a log collection plug-in an exemplary embodiment of the present disclosure;
FIG. 4 is a flow chart of another method for hot-updating of a log collection plug-in an exemplary embodiment of the present disclosure;
FIG. 5 is a flow chart of another method for hot-updating of a log collection plug-in an exemplary embodiment of the present disclosure;
FIG. 6 is a flow chart of another method for hot-updating of a log collection plug-in an exemplary embodiment of the present disclosure;
FIG. 7 is a flowchart of another method for hot-updating of a log collection plug-in an exemplary embodiment of the present disclosure;
FIG. 8 is a flow chart of another method for hot-updating of a log collection plug-in an exemplary embodiment of the present disclosure;
FIG. 9 is a block diagram of a hot update mechanism of a log collection plug-in an exemplary embodiment of the disclosure;
FIG. 10 is a block diagram of another log collection plug-in thermal update apparatus in an exemplary embodiment of the present disclosure;
FIG. 11 is a schematic flow chart diagram illustrating a hot update scheme for a log collection plug-in an exemplary embodiment of the present disclosure;
fig. 12 is a block diagram of an electronic device in an exemplary embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Further, the drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
FIG. 1 sets forth a schematic diagram of an exemplary system architecture for a hot update scheme of a log collection plug-in to which embodiments of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and the like.
In some embodiments, the method for updating the log collection plug-in thermally is generally performed by the terminal 105, and accordingly, the means for updating the log collection plug-in thermally is generally disposed in the terminal device 103 (which may also be the terminal device 101 or 102). In other embodiments, some servers may have similar functionality as the terminal device to perform the method. Therefore, the hot update method of the log collection plug-in provided by the embodiment of the invention is not limited to be executed by the terminal equipment.
The following detailed description of exemplary embodiments of the disclosure refers to the accompanying drawings.
FIG. 2 is a flow chart of a method for hot-updating of a log collection plug-in an exemplary embodiment of the disclosure.
Referring to fig. 2, a method for hot-updating a log collection plug-in may include:
step S202, judging whether a monitoring example detects that the log configuration file generates a specified event or not, wherein the monitoring example is created aiming at the log configuration file of the log collection plug-in.
Step S204, reloading the log configuration file according to the detected specified event, where the specified event includes an event that edits the log configuration file and/or an event that the log configuration file is closed.
According to the embodiment of the disclosure, whether the monitoring example detects that the log configuration file generates the specified event is judged, and the log configuration file is reloaded according to the detected specified event, so that the log collection plug-in supports hot update, and the efficiency and the fluency of log collection are improved.
In one embodiment of the present disclosure, the log collection plugin is a plugin for the fluent-bit.
The following describes the steps of the hot update method of the log collection plug-in detail.
In an exemplary embodiment of the disclosure, as shown in fig. 3, the method for hot updating of the log collection plug-in further includes:
step S302, if it is determined that the specified event is not detected by the listening instance, polling is performed to detect whether the log configuration file generates the specified event.
In the above embodiment, if the specified event is not detected, it is determined that the log configuration file of the log collection plug-in is not updated or closed, reloading is not required, and polling is continuously performed on the specified event of the log configuration file.
In an exemplary embodiment of the present disclosure, as shown in fig. 4, further includes:
step S402, creating a monitoring example for the log configuration file of the log collection plug-in.
Step S404, determining a file descriptor corresponding to the monitoring instance, where the file descriptor is used to describe a specific file, and the specific file is used to store an event occurring in the log configuration file.
In the above embodiment, the listening instance is used to monitor all events of the log configuration file, and store all events in a specific file through the file descriptor.
In an exemplary embodiment of the present disclosure, as shown in fig. 5, reloading the log configuration file according to the detected specified event includes:
step S502, if the specified event is detected, the specified event is sent to an event queue of the specified file.
Step S504, traverse all events in the event queue.
Step S506, determining whether all events in the event queue include the specified event, if yes, performing step S508, and if no, returning to perform step S506.
Step S508, if the specified event is detected, reloading the log configuration file.
In the above embodiment, if the specified event is detected, the log configuration file is reloaded, and the log configuration file is updated without restarting the process corresponding to the log collection plug-in, and the log can be continuously collected in real time.
In an exemplary embodiment of the disclosure, as shown in fig. 6, the method for hot updating of the log collection plug-in further includes:
step S602, determining configuration information of the log collection plug-in, wherein the configuration information comprises at least one of a server IP, a collection object and a log storage path.
In an exemplary embodiment of the present disclosure, the server IP is an IP address of a server to which the log collection plug-in belongs.
Step S604, editing the log configuration file according to the configuration information.
In an exemplary embodiment of the disclosure, as shown in fig. 7, the method for hot updating of the log collection plug-in further includes:
step S702, determining the log obtained by the log collection plug-in.
Step S704, analyzing the log according to a preset regular expression to extract attribute information of the log, wherein the attribute information comprises log generation time, log grade and log content.
Step S706, merging the analyzed multiple rows of the logs.
In the embodiment, through the regular parsing rules of various log formats and the support of the merged output of multiple rows of logs, a more intuitive log analysis result is provided for the client.
In an exemplary embodiment of the disclosure, as shown in fig. 8, the method for hot updating of the log collection plug-in further includes:
step S802, the log acquired by the log acquisition plug-in is preprocessed, wherein the preprocessing comprises at least one of input, filtering, normalization and standardization.
Step S804, the preprocessed log is transmitted to the middleware node in a designated format.
In the embodiment, the log acquired by the log acquisition plug-in is preprocessed, so that redundant log data are reduced, and in addition, the preprocessed log is transmitted to the middleware node in a specified format, so that the data storage pressure of the server is reduced, and the response time of the client for requesting the log from the middleware node is also reduced.
Corresponding to the method embodiment, the disclosure also provides a hot update device of the log collection plug-in, which can be used for executing the method embodiment.
FIG. 9 is a block diagram of a hot update mechanism of a log collection plugin in an exemplary embodiment of the present disclosure.
Referring to fig. 9, the hot update apparatus 900 of the log collection plug-in may include:
a determining module 902 configured to determine whether a listening instance is detected that the log configuration file generates a specified event, where the listening instance is created for the log configuration file of the log collection plug-in.
A loading module 904 configured to reload the log configuration file according to the detected specified event, wherein the specified event includes an event of editing the log configuration file and/or an event of closing the log configuration file.
In the above embodiment, the hot update apparatus 900 of the log collection plug-in may collect logs in real time in a variety of environments, such as a physical machine, a virtual machine, a K8S container, and the like.
In an exemplary embodiment of the present disclosure, the log collection plug-in hot update apparatus 900 is further configured to: if the monitoring example is judged not to detect the specified event, polling is conducted to detect whether the log configuration file generates the specified event or not.
In an exemplary embodiment of the present disclosure, the log collection plug-in hot update apparatus 900 is further configured to: creating a monitoring example aiming at the log configuration file of the log collection plug-in; and determining a file descriptor corresponding to the monitoring example, wherein the file descriptor is used for describing a specified file, and the specified file is used for storing events generated by the log configuration file.
In an exemplary embodiment of the disclosure, the loading module 904 is further configured to: if the specified event is judged to be detected, sending the specified event to an event queue of the specified file; traversing all events in the event queue; judging whether all events in the event queue contain the specified event or not; and if the specified event is detected, reloading the log configuration file.
In an exemplary embodiment of the present disclosure, the log collection plug-in hot update apparatus 900 is further configured to: determining configuration information of the log acquisition plug-in, wherein the configuration information comprises at least one of a server IP, an acquisition object and a log storage path; and editing the log configuration file according to the configuration information.
In an exemplary embodiment of the present disclosure, the log collection plug-in hot update apparatus 900 is further configured to: determining a log obtained by the log acquisition plug-in; analyzing the log according to a preset regular expression to extract attribute information of the log, wherein the attribute information comprises log generation time, log grade and log content; and merging the analyzed logs of multiple lines.
In an exemplary embodiment of the present disclosure, the log collection plug-in hot update apparatus 900 is further configured to: preprocessing the log acquired by the log acquisition plug-in, wherein the preprocessing comprises at least one of input, filtering, normalization and standardization; and transmitting the preprocessed log to a middleware node in a specified format.
Since the functions of the log collection plug-in hot update apparatus 900 have been described in detail in the corresponding method embodiments, the details of the disclosure are not repeated herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In an exemplary embodiment of the present disclosure, as shown in fig. 10, the hot update platform of the log collection plug-in includes a deployment module 1002, a configuration module 1004, a collection module 1006, a storage module 1008, a parsing module 1010, and the like.
The deployment module 1002: and providing automatic deployment of the fluent-bit acquisition software by the deployment script.
The configuration module 1004: and providing the configuration of log collection requirements, including a server IP, a collected system module, a log path and the like.
An acquisition module 1006: basic operations of log collection server and log input, filtering and output are provided, and a monitoring submodule 10062 is arranged in the collection module 1006 to realize polling monitoring of the configuration module.
The storage module 1008: and providing storage of log collection results, and outputting the collected logs to kafka message middleware in a json format for further subsequent processing.
The analysis module 1010: regular expression analysis in various log formats is provided, log time, log levels, log contents and the like can be extracted, and multiple rows of logs are merged.
In an exemplary embodiment of the present disclosure, as shown in fig. 11, a hot update flow of the log collection plug-in includes:
step S1102, initializing the listening submodule.
Step S1104, add the monitoring event of the log configuration file.
Step S1106, add the listening event to the event queue.
Step S1108, a listening event queue is obtained.
Step S1110, traverse all events.
In step S1112, it is determined whether the specified event has occurred, and if so, step S1114 is executed, and if not, step S1108 is executed.
Step S1114 loads a log configuration file.
An electronic device 1200 according to this embodiment of the invention is described below with reference to fig. 12. The electronic device 1200 shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 12, the electronic device 1200 is embodied in the form of a general purpose computing device. The components of the electronic device 1200 may include, but are not limited to: the at least one processing unit 1210, the at least one memory unit 1220, and a bus 1230 connecting the various system components including the memory unit 1220 and the processing unit 1210.
Wherein the memory unit stores program code that is executable by the processing unit 1210 such that the processing unit 1210 performs steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 1210 may perform a method as shown in embodiments of the present disclosure.
The storage unit 1220 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)12201 and/or a cache memory unit 12202, and may further include a read only memory unit (ROM) 12203.
The electronic device 1200 can also communicate with one or more external devices 1240 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1200, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1200 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 1250. Also, the electronic device 1200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 1260. As shown, the network adapter 1260 communicates with the other modules of the electronic device 1200 via the bus 1230. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product for implementing the above method according to an embodiment of the present invention may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims (10)
1. A method for hot updating of a log collection plug-in, comprising:
judging whether a monitoring example detects that the log configuration file generates a specified event or not, wherein the monitoring example is created aiming at the log configuration file of the log acquisition plug-in;
reloading the log configuration file in accordance with the detected specified event,
wherein the specified event comprises an event of editing the log configuration file and/or an event of closing the log configuration file.
2. The method for hot-updating a log collection plug-in of claim 1, further comprising:
if the monitoring example is judged not to detect the specified event, polling is conducted to detect whether the log configuration file generates the specified event or not.
3. The method for hot-updating a log collection plug-in of claim 1, further comprising:
creating a monitoring example aiming at the log configuration file of the log collection plug-in;
and determining a file descriptor corresponding to the monitoring example, wherein the file descriptor is used for describing a specified file, and the specified file is used for storing events generated by the log configuration file.
4. The method for hot-updating of a log collection plug-in of claim 1, wherein reloading the log configuration file in accordance with the detected specified event comprises:
if the specified event is judged to be detected, sending the specified event to an event queue of the specified file;
traversing all events in the event queue;
judging whether all events in the event queue contain the specified event or not;
and if the specified event is detected, reloading the log configuration file.
5. The method for thermal update of a log collection plug-in of any of claims 1-4, further comprising:
determining configuration information of the log acquisition plug-in, wherein the configuration information comprises at least one of a server IP, an acquisition object and a log storage path;
and editing the log configuration file according to the configuration information.
6. The method for thermal update of a log collection plug-in of any of claims 1-4, further comprising:
determining a log obtained by the log acquisition plug-in;
analyzing the log according to a preset regular expression to extract attribute information of the log, wherein the attribute information comprises log generation time, log grade and log content;
and merging the analyzed logs of multiple lines.
7. The method for thermal update of a log collection plug-in of any of claims 1-4, further comprising:
preprocessing the log acquired by the log acquisition plug-in, wherein the preprocessing comprises at least one of input, filtering, normalization and standardization;
and transmitting the preprocessed log to a middleware node in a specified format.
8. A log collection plug-in thermal update apparatus, comprising:
the judging module is used for judging whether a monitoring example detects that the log configuration file generates a specified event or not, wherein the monitoring example is established aiming at the log configuration file of the log acquisition plug-in;
a loading module configured to reload the log configuration file according to the detected specified event,
wherein the specified event comprises an event of editing the log configuration file and/or an event of closing the log configuration file.
9. An electronic device, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the method of thermal update of a log collection plugin of any of claims 1-7 based on instructions stored in the memory.
10. A computer-readable storage medium on which a program is stored, which when executed by a processor implements the method for thermal update of a log collection plug-in according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210044143.7A CN114371888A (en) | 2022-01-14 | 2022-01-14 | Method and device for hot updating of log collection plug-in, electronic equipment and readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210044143.7A CN114371888A (en) | 2022-01-14 | 2022-01-14 | Method and device for hot updating of log collection plug-in, electronic equipment and readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114371888A true CN114371888A (en) | 2022-04-19 |
Family
ID=81144093
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210044143.7A Pending CN114371888A (en) | 2022-01-14 | 2022-01-14 | Method and device for hot updating of log collection plug-in, electronic equipment and readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114371888A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114968407A (en) * | 2022-05-30 | 2022-08-30 | 北京金堤科技有限公司 | Plug-in calling method and device, electronic equipment and storage medium |
CN116708063A (en) * | 2022-12-23 | 2023-09-05 | 荣耀终端有限公司 | Log reporting method, electronic equipment, cloud server and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002366394A (en) * | 2002-03-28 | 2002-12-20 | Hitachi Ltd | Collection and management method for log data |
JP2012175389A (en) * | 2011-02-21 | 2012-09-10 | Nippon Telegr & Teleph Corp <Ntt> | Log collection automated device, log collection automation test system and log collection control method |
CN106534257A (en) * | 2016-09-29 | 2017-03-22 | 国家电网公司 | Multi-level cluster-type construction multi-source safety log collection system and method |
CN108600029A (en) * | 2018-05-09 | 2018-09-28 | 深圳壹账通智能科技有限公司 | A kind of configuration file update method, device, terminal device and storage medium |
CN113391973A (en) * | 2021-05-24 | 2021-09-14 | 青岛海信智慧生活科技股份有限公司 | Internet of things cloud container log collection method and device |
CN113688002A (en) * | 2021-07-28 | 2021-11-23 | 济南浪潮数据技术有限公司 | Log collection method and related device |
-
2022
- 2022-01-14 CN CN202210044143.7A patent/CN114371888A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002366394A (en) * | 2002-03-28 | 2002-12-20 | Hitachi Ltd | Collection and management method for log data |
JP2012175389A (en) * | 2011-02-21 | 2012-09-10 | Nippon Telegr & Teleph Corp <Ntt> | Log collection automated device, log collection automation test system and log collection control method |
CN106534257A (en) * | 2016-09-29 | 2017-03-22 | 国家电网公司 | Multi-level cluster-type construction multi-source safety log collection system and method |
CN108600029A (en) * | 2018-05-09 | 2018-09-28 | 深圳壹账通智能科技有限公司 | A kind of configuration file update method, device, terminal device and storage medium |
CN113391973A (en) * | 2021-05-24 | 2021-09-14 | 青岛海信智慧生活科技股份有限公司 | Internet of things cloud container log collection method and device |
CN113688002A (en) * | 2021-07-28 | 2021-11-23 | 济南浪潮数据技术有限公司 | Log collection method and related device |
Non-Patent Citations (1)
Title |
---|
恋恋风辰: "Go项目实战:打造高并发日志采集系统(三)", pages 1 - 3, Retrieved from the Internet <URL:https://blog.csdn.net/secondtonone1/article/details/103350720> * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114968407A (en) * | 2022-05-30 | 2022-08-30 | 北京金堤科技有限公司 | Plug-in calling method and device, electronic equipment and storage medium |
CN114968407B (en) * | 2022-05-30 | 2024-03-08 | 北京金堤科技有限公司 | Plug-in calling method, device, electronic equipment and storage medium |
CN116708063A (en) * | 2022-12-23 | 2023-09-05 | 荣耀终端有限公司 | Log reporting method, electronic equipment, cloud server and storage medium |
CN116708063B (en) * | 2022-12-23 | 2024-06-11 | 荣耀终端有限公司 | Log reporting method, electronic equipment, cloud server and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108897691B (en) | Data processing method, device, server and medium based on interface simulation service | |
US9804862B2 (en) | Translatable texts identification in in-context localization utilizing pseudo-language and an external server | |
CN111190888A (en) | Method and device for managing graph database cluster | |
JP2021103506A (en) | Method and device for generating information | |
US20180024848A1 (en) | Translatable Texts Identification in In-Context Localization Utilizing Pseudo-Language and an External Server | |
US11934287B2 (en) | Method, electronic device and computer program product for processing data | |
CN110858172A (en) | Automatic test code generation method and device | |
CN114371888A (en) | Method and device for hot updating of log collection plug-in, electronic equipment and readable medium | |
CN110955640A (en) | Cross-system data file processing method, device, server and storage medium | |
CN113760729A (en) | Code detection method and device | |
US10033687B2 (en) | Interactive splitting of entries in social collaboration environments | |
CN111552895B (en) | Page route analysis method, system, equipment and medium in applet application | |
CN111427899A (en) | Method, device, equipment and computer readable medium for storing file | |
CN114840379A (en) | Log generation method, device, server and storage medium | |
CN110647331A (en) | Development tool acquisition method and device, storage medium and electronic equipment | |
CN110110032B (en) | Method and device for updating index file | |
CN113282285B (en) | Code writing method, device, electronic equipment and storage medium | |
CN115454956A (en) | Log generation method and device, electronic equipment and storage medium | |
US11714699B2 (en) | In-app failure intelligent data collection and analysis | |
CN107679230B (en) | Information processing method, system, medium, and computing device | |
CN109756393B (en) | Information processing method, system, medium, and computing device | |
CN113778847A (en) | Test report generation method and device | |
CN110096392B (en) | Method and device for outputting information | |
CN111178014A (en) | Method and device for processing business process | |
CN118170688B (en) | Configuration file detection method and device, storage medium and electronic equipment |
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 |