Log collection device, method and computer readable storage medium
By using multiple enqueuing threads and atomic operations to write and read logs in the ring queue during the log collection process, the problem of interference of log collection on core business performance and insufficient timeliness is solved, and high stability and high performance are achieved. Efficient log collection.
Patent Information
- Application Number
- CN202010218588.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-25
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-03-25
AI Technical Summary
In the existing technology, there are problems in the log collection process that interfere with core business performance and cannot meet timeliness.
Multiple enqueuing threads are used to write logs into the ring queue, and logs in the ring queue are obtained and cleared in batches through atomic operations to achieve asynchronous log collection. The ring queue and lock-free, non-blocking multi-thread operations are used to improve system stability. sex and timeliness.
Asynchronous log collection is implemented, which improves system stability and timeliness during the log collection process and meets the requirements of high throughput and low latency.
Smart Images

Figure CN112306827B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a log collection device, method and computer-readable storage medium. Background Art
[0002] In many Internet client (or C-end) business systems, it is often necessary to record business data logs, which can be used to record the behavior data of the business system to facilitate tracing problems and retaining traces. For example, logs can record core state changes and external system calls. In addition, logs can also be used for real-time calculations and trend analysis.
[0003] This type of logging behavior has the following characteristics or requirements:
[0004] (1) It does not belong to the core business process and the impact on the core business process should be minimized;
[0005] (2) The call volume is relatively large, and the log storage takes up a lot of space;
[0006] (3) Some business logs have high requirements for timeliness and need to be recorded as quickly as possible so that data analysis such as real-time prediction of order volume and status change trajectory can be performed as soon as possible.
[0007] In the related art, the following log collection scheme can be used. For example, an independent business log service can be created, and the business system writes the log synchronously to the log service through the remote procedure call (RPC) interface. For another example, log collection is completed using a third-party tool. Through a log framework, such as the log4j log framework for JAVA, print the log to the local disk, and then use the log collection agent (agent) to extract the log file, and forward the extracted log file to the background log service; or, use the log framework and cooperate with log collection tools such as kafka, print the log into the log collection tool, and forward it to the kafka server for message consumption. Summary of the invention
[0008] After analysis, the inventor found that in the related art, the RPC synchronous call method would interfere with the call performance of the core business, resulting in instability of the business system. The method of using third-party tools is not flexible enough in deployment, and the timeliness of log records cannot be met.
[0009] A technical problem to be solved by the embodiments of the present invention is: how to improve the system stability and timeliness in the log collection process.
[0010] According to a first aspect of some embodiments of the present invention, a log collection method is provided, comprising: in response to obtaining logs, writing logs into a circular queue through multiple enqueue threads, and when writing logs through each enqueue thread, cyclically trying to obtain an enqueue pointer corresponding to the circular queue and writing logs to the next position pointed to by the enqueue pointer until the writing is successful, and the writing is successful when the next position pointed to by the enqueue pointer is empty; reading logs from the circular queue according to a dequeue pointer corresponding to the circular queue; and sending the read logs to a server.
[0011] In some embodiments, each circular queue corresponds to a dequeue thread; reading logs from the circular queue according to the dequeue pointer corresponding to the circular queue includes: obtaining logs in the corresponding circular queue in batches by using atomic operations through the dequeue thread, and clearing the read logs in the corresponding circular queue.
[0012] In some embodiments, there are multiple circular queues; the log collection method further includes: determining a hash value of the time when the log is obtained; and allocating the log to the circular queue corresponding to the hash value for storage.
[0013] In some embodiments, the log collection method further includes: when the next position pointed to by the queue pointer is not empty, allocating other circular queues for storing the corresponding logs.
[0014] In some embodiments, the log collection method further includes: initializing a preset number of circular queues; and creating a new circular queue in response to the current queues being full.
[0015] In some embodiments, the log collection method further includes: when the number of current circular queues is higher than the initial number of queues and the time length from the last time the circular queue was written into the log to the current time exceeds a threshold, destroying the corresponding circular queue.
[0016] In some embodiments, the log collection method further includes: after obtaining an instruction to end the process corresponding to the log collection service, locally storing the logs in the circular queue; and sending the locally stored messages to the server when the log collection service is started next time.
[0017] In some embodiments, the circular queue is implemented by an atomic array structure.
[0018] According to a second aspect of some embodiments of the present invention, a log collection device is provided, comprising: a log collection interface, configured to obtain logs; a circular queue, configured to store logs, an enqueue pointer corresponding to the circular queue points to the last written position in the circular queue, and a dequeue pointer points to the last read position in the circular queue; an enqueue module, comprising multiple enqueue threads, each of which is configured to cyclically attempt to obtain an enqueue pointer and write a log to a position next to the position pointed to by the enqueue pointer until the write is successful, and the write is successful when the position next to the position pointed to by the enqueue pointer is empty; the dequeue module is configured to read the log from the circular queue according to the dequeue pointer, and send the read log to a log sending component; the log sending component is configured to send the obtained log to a server.
[0019] According to a third aspect of some embodiments of the present invention, there is provided a log collection device, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute any one of the aforementioned log collection methods based on instructions stored in the memory.
[0020] According to a fourth aspect of some embodiments of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program implements any of the aforementioned log collection methods when executed by a processor.
[0021] Some embodiments of the above invention have the following advantages or beneficial effects: The present invention can realize asynchronous log collection. In addition, in the process of temporarily storing logs locally, the system stability and timeliness of the log collection process are improved by using a circular queue and lock-free, non-blocking multi-threaded operations, meeting the requirements of high throughput and low latency.
[0022] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 A schematic flow chart of a log collection method according to some embodiments of the present invention is shown.
[0025] Figure 2 A schematic flow chart of a ring queue allocation method according to some embodiments of the present invention is shown.
[0026] Figure 3 A schematic flow chart of an elasticity management method according to some embodiments of the present invention is shown.
[0027] Figure 4 A schematic flow chart of a service exit processing method according to some embodiments of the present invention is shown.
[0028] Figure 5 A schematic diagram of the structure of a log collection device according to some embodiments of the present invention is shown.
[0029] Figure 6 A schematic diagram of the structure of a log collection device according to some other embodiments of the present invention is shown.
[0030] Figure 7 A schematic structural diagram of a log collection device according to some further embodiments of the present invention is shown. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] The relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0033] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0034] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0035] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0036] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0037] Figure 1FIG. 1 is a flow chart showing a log collection method according to some embodiments of the present invention. Figure 1 As shown, the log collection method of this embodiment includes steps S102 to S106.
[0038] In step S102, in response to obtaining the log, the log is written into the circular queue through multiple enqueuing threads, and when writing the log through each enqueuing thread, a loop attempts to obtain the enqueuing pointer corresponding to the circular queue and writes the log to the next position pointed to by the enqueuing pointer until the writing is successful, wherein the writing is successful when the next position pointed to by the enqueuing pointer is empty. After the writing is successful, the enqueuing thread updates the write pointer to point to the location where the data it writes is located.
[0039] The circular queue is used to store logs. Each circular queue corresponds to an entry pointer and a dequeue pointer. For example, pushIndex and pullIndex are used to represent the entry pointer and the dequeue pointer respectively. The circular queue can be implemented by an array. pushIndex represents the subscript value of the latest log entered in the array. For each log entered, pushIndex increases by 1, and returns to 0 when the value of pushIndex grows to the array capacity boundary, thus forming a circular data structure. pullIndex represents the subscript value of the latest log of the message dequeued in the array. For each log dequeued, pullIndex increases by 1. When the value of pullIndex grows to the array capacity boundary, it also returns to 0. Thus, data can be stored in the queue or read from the queue sequentially. This structure is suitable for the scenario of log temporary storage of the present invention.
[0040] In some embodiments,
[0041] In some embodiments, one or more circular queues are set as needed for temporary storage of logs, and each queue corresponds to a plurality of queueing threads for writing logs.
[0042] The thread pool in the related art (such as JAVA thread pool) usually uses a blocking queue. When the number of messages in the queue is large, the thread switching and lock contention caused by blocking will cause a large overhead, thereby reducing the message processing speed. The method adopted in step S102 avoids lock contention and thread switching.
[0043] Ideally, the next position pointed to by the enqueue pointer should be empty. If the next position is not empty, it means that other threads have already written the log first. At this time, the enqueue pointer does not need to be reloaded. It only needs to repeat the process of obtaining the enqueue pointer and judging whether the next position pointed to by the enqueue pointer is empty until the writing condition is met and the writing is successful. This method does not require locking and blocking, and can also maintain the accuracy of log writing.
[0044] In some embodiments, the circular queue is implemented by an atomic array structure, that is, all operations on the circular queue are atomic, ensuring the accuracy of the operation. In some embodiments, a Compare And Set (CAS) mechanism can be used to implement the write process.
[0045] In step S104, the log is read from the circular queue according to the dequeue pointer corresponding to the circular queue.
[0046] In some embodiments, each circular queue corresponds to a dequeue thread. The dequeue thread reads messages by continuously polling. In this case, there is no competition between threads, so there is no need to perform locking processing.
[0047] In some embodiments, logs in the corresponding circular queue are obtained in batches by using an atomic operation through a dequeue thread, and the read logs in the corresponding circular queue are cleared. Thus, the timeliness of log reading can be improved. Moreover, the atomic operation ensures the accuracy of log reading.
[0048] The pointer of the circular queue needs to be recycled. In order to increase the calculation speed, the capacity of the circular queue can be set to an exponent of 2 to calculate the pointer by bit operation, thereby improving the calculation efficiency. In some embodiments, the queue entry pointer and the queue exit pointer are represented in binary form. Taking the queue entry pointer as an example, after writing the log and adding 1 to the value of the queue entry pointer, the binary representation of the queue entry pointer and the capacity of the circular queue minus 1 is ANDed. When the queue entry pointer exceeds the capacity of the circular queue after adding 1, this operation can return the queue entry pointer to the initial value, achieving a circular effect.
[0049] In step S106, the read log is sent to the server. For example, the log can be sent to the server via HyperText Transfer Protocol (HTTP).
[0050] Through the method of the above embodiment, the present invention can realize asynchronous log collection. In addition, in the process of temporarily storing logs locally, the circular queue and lock-free, non-blocking multi-threaded operation are used to improve the system stability and timeliness in the log collection process, meeting the requirements of high throughput and low latency.
[0051] When there are multiple ring queues, you can allocate a ring queue for the logs to be written to store them. Figure 2 An embodiment of a ring queue allocation method is described.
[0052] Figure 2 FIG. 2 shows a flow chart of a ring queue allocation method according to some embodiments of the present invention. Figure 2 As shown, the ring queue allocation method of this embodiment includes steps S202 to S204.
[0053] In step S202, a hash value of the time when the log is obtained is determined. For example, the time when the log is obtained is divided by the total number of circular queues, and the remainder obtained is used as the hash value.
[0054] In step S204, the log is assigned to the circular queue corresponding to the hash value for storage.
[0055] If the allocated circular queue is full, other circular queues can be allocated for storage of the logs, for example, the next circular queue is allocated. In some embodiments, it is determined whether the next position of the position pointed to by the queue pointer is empty. If it is not empty, other circular queues are allocated for storage of the corresponding logs.
[0056] By using the method of the above embodiment, even distribution of logs among various ring queues can be achieved as much as possible.
[0057] In order to adapt to the situation where the number of logs increases, the present invention can also realize the elastic expansion of the ring queue. Figure 3 An embodiment of the elasticity management method of the present invention is described.
[0058] Figure 3 FIG. 2 is a flow chart showing a method for elastic management according to some embodiments of the present invention. Figure 3 As shown, the elasticity management method of this embodiment includes steps S302 to S304.
[0059] In step S302, a preset number of ring queues is initialized, and the preset number may be configured in advance.
[0060] In step S304, in response to the current queues being full, a new circular queue is created.
[0061] In some embodiments, an upper limit on the number of circular queues can be set. When the created circular queue reaches the upper limit but new logs are still being generated, the logs that cannot be stored in the circular queue can be sent directly to the server. Thus, when the log operation pressure is high, the synchronous and asynchronous modes of log recording are combined to reduce the impact on system performance.
[0062] The present invention can also realize elastic shrinkage of the ring queue. For example, the elastic management method can also include step S306.
[0063] In step S306, when the number of current circular queues is higher than the number of initial queues and the time length from the last time a circular queue is written into a log to the current time exceeds a threshold, the corresponding circular queue is destroyed.
[0064] Therefore, when the log operation pressure decreases, the circular queues can be gradually destroyed, and finally the number of circular queues is kept at the initial level, thereby improving the performance of the system.
[0065] When the log collection service exits, there may still be unread messages in the ring queue. The present invention can handle this situation appropriately. Figure 4 An embodiment of the service exit processing method of the present invention is described.
[0066] Figure 4 FIG. 2 is a flow chart showing a service exit processing method according to some embodiments of the present invention. Figure 4 As shown, the service exit processing method of this embodiment includes steps S402 to S404.
[0067] In step S402, after obtaining an instruction to end the process corresponding to the log collection service, the logs in the ring queue are stored locally.
[0068] In some embodiments, after obtaining an instruction to end the process corresponding to the log collection service, you can first try to dequeue the logs in the circular queue and instruct the main process to wait; after the waiting time exceeds the preset waiting time, if there is still data in the circular queue, these logs will be stored locally.
[0069] In step S404, when the log collection service is started next time, the locally stored message is sent to the server.
[0070] In some embodiments, when reading and writing locally stored logs, a random access file (RandomAccessFile) class can be used to process. During the processing, the read and write pointers of the file can be recorded, and the endpoint continuation of the file content can be supported to improve the stability of log upload. In some embodiments, when performing a read operation, the read data is copied to avoid interference between the read and write threads.
[0071] Through the method of the above embodiment, the log collection service can be exited safely and reliably.
[0072] Reference below Figure 5 An embodiment of the log collection device of the present invention is described.
[0073] Figure 5 FIG. 1 shows a schematic diagram of the structure of a log collection device according to some embodiments of the present invention. Figure 5 As shown, the log collection device 50 of this embodiment includes a log collection interface 510 , a circular queue 520 , an enqueue module 530 , a dequeue module 540 and a log sending component 550 .
[0074] The log collection interface 510 is configured to obtain logs.
[0075] In some embodiments, the log collection device 50 can be encapsulated as a module such as a component, library file, package, etc., for example, in the form of a Jar package. The business process initiates a call to the module through the log collection interface 510 to pass in the log to be recorded. Therefore, there is no need to integrate the log processing logic in the business logic. It is only necessary to introduce the log collection device 50 in the business system and configure the business identifier so that the server can distinguish which business system the received log is obtained from.
[0076] The circular queue 520 is configured to store logs, wherein an enqueue pointer corresponding to the circular queue points to the last written position in the circular queue, and a dequeue pointer points to the last read position in the circular queue.
[0077] The enqueue module 530 includes multiple enqueue threads, each of which is configured to cyclically attempt to obtain an enqueue pointer and write a log to the next position pointed to by the enqueue pointer until the write succeeds, wherein the write succeeds when the next position pointed to by the enqueue pointer is empty.
[0078] The dequeue module 540 is configured to read logs from the circular queue according to the dequeue pointer, and send the read logs to the log sending component.
[0079] The log sending component 550 is configured to send the acquired logs to the server.
[0080] In some embodiments, the dequeue module 540 includes a dequeue thread, and each circular queue corresponds to a dequeue thread; the dequeue thread is configured to batch obtain logs in the corresponding circular queue through atomic operations and clear the read logs in the corresponding circular queue.
[0081] In some embodiments, the log collection device 50 further includes: a queue allocation module 560 configured to allocate the logs acquired by the log collection interface 510 to a circular queue for storage.
[0082] In some embodiments, the queue allocation module 560 is further configured to determine a hash value of the time when the log collection interface 510 acquires the log, and allocate the log to a circular queue corresponding to the hash value for storage.
[0083] In some embodiments, the enqueue thread is further configured to feedback write failure to the queue allocation module 560 when the next position pointed to by the enqueue pointer is not empty, so that the queue allocation module 560 allocates other circular queues for storage of the corresponding logs.
[0084] In some embodiments, the log collection device 50 further includes: a queue management module 570 configured to initialize an initial number of circular queues, and to create a new circular queue in response to the current queues being full.
[0085] In some embodiments, the queue management module 570 is further configured to destroy the corresponding circular queue when the number of current circular queues is higher than the initial number of queues and the time between the last time the circular queue was written into the log and the current time exceeds a threshold.
[0086] In some embodiments, the log collection device 50 also includes: a log cache module 580, which is configured to locally store the logs in the circular queue upon obtaining an instruction to end the process corresponding to the log collection device 50, so that when the log collection device is started next time, the locally stored messages are sent to the server through the log sending component.
[0087] In some embodiments, the circular queue is implemented by an atomic array structure.
[0088] Figure 6 FIG. 2 shows a schematic diagram of the structure of a log collection device according to some other embodiments of the present invention. Figure 6 As shown, the log collection device 60 of this embodiment includes: a memory 610 and a processor 620 coupled to the memory 610 , and the processor 620 is configured to execute the log collection method in any of the aforementioned embodiments based on the instructions stored in the memory 610 .
[0089] The memory 610 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.
[0090] Figure 7 FIG. 2 shows a schematic diagram of the structure of a log collection device according to some other embodiments of the present invention. Figure 7 As shown, the log collection device 70 of this embodiment includes: a memory 710 and a processor 720, and may also include an input / output interface 730, a network interface 740, a storage interface 750, etc. These interfaces 730, 740, 750 and the memory 710 and the processor 720 may be connected, for example, via a bus 760. Among them, the input / output interface 730 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 740 provides a connection interface for various networked devices. The storage interface 750 provides a connection interface for external storage devices such as SD cards and USB flash drives.
[0091] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements any of the aforementioned log collection methods when executed by a processor.
[0092] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0093] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A log collection method, comprising: In response to obtaining a log, the log is written into a circular queue through a plurality of enqueuing threads, and when the log is written through each enqueuing thread, a loop is attempted to obtain an enqueuing pointer corresponding to the circular queue, and the log is written to a position next to the position pointed to by the enqueuing pointer until the writing succeeds, wherein the writing succeeds when the position next to the position pointed to by the enqueuing pointer is empty, and the enqueuing pointer points to a position corresponding to the subscript value of the latest log written into the circular queue in the array of the circular queue; Reading a log from the circular queue according to a dequeue pointer corresponding to the circular queue; Send the read logs to the server; After obtaining an instruction to end the process corresponding to the log collection service, the logs in the ring queue are stored locally; When the log collection service is started next time, the locally stored message is sent to the server.
2. The log collection method according to claim 1, wherein: Each ring queue corresponds to a dequeue thread; The reading a log from the circular queue according to a dequeue pointer corresponding to the circular queue comprises: The logs in the corresponding circular queue are acquired in batches by using the dequeue thread and atomic operations, and the read logs in the corresponding circular queue are cleared.
3. The log collection method according to claim 1, wherein: There are multiple circular queues; The log collection method further includes: A hash value that determines the time when the log was obtained; The log is allocated to the circular queue corresponding to the hash value for storage.
4. The log collection method according to claim 1, further comprising: When the next position pointed to by the queue pointer is not empty, other circular queues are allocated for storing the corresponding logs.
5. The log collection method according to claim 1, further comprising: Initialize a preset number of circular queues; In response to the current queues being full, a new ring queue is created.
6. The log collection method according to claim 1, further comprising: When the number of current circular queues is higher than the initial number of queues and the time length between the last time the circular queue was written into the log and the current time exceeds a threshold, the corresponding circular queue is destroyed.
7. The log collection method according to any one of claims 1 to 6, wherein: The circular queue is implemented by an atomic array structure.
8. A log collection device, comprising: The log collection interface is configured to obtain logs; A circular queue is configured to store logs, wherein an enqueue pointer corresponding to the circular queue points to a last written position in the circular queue, and a dequeue pointer points to a last read position in the circular queue; An enqueue module, comprising a plurality of enqueue threads, each of which is configured to cyclically attempt to obtain the enqueue pointer and write the log to a position next to the position pointed to by the enqueue pointer until the writing succeeds, wherein the writing succeeds when the position next to the position pointed to by the enqueue pointer is empty, and the enqueue pointer points to a position corresponding to the subscript value of the latest log written to the circular queue in the array of the circular queue; A dequeue module, configured to read logs from the circular queue according to the dequeue pointer, and send the read logs to a log sending component; A log sending component is configured to send the acquired logs to the server; The log cache module is configured to locally store the logs in the circular queue when obtaining an instruction to end the process corresponding to the log collection device, so that when the log collection device is started next time, the locally stored messages are sent to the server through the log sending component.
9. A log collection device, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the log collection method according to any one of claims 1 to 7 based on instructions stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the log collection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Log output method and apparatus, terminal device and storage medium
CN108509327A
Log synchronization method and device, storage medium and electronic equipment
CN110019498A
