Automatic log collection method and device, computer equipment and storage medium
By deploying application container management system and log collector resources on cloud computing platforms in the financial technology field, and configuring application custom startup scripts, the existing automated log collection methods have solved the problems of large amounts of changes, complex operations and high risks, and scattered configurations, realizing timely collection of log data and efficient system maintenance.
Patent Information
- Application Number
- CN202411718811.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-21
AI Technical Summary
The existing automated log collection methods have problems such as large amount of changes, high risk of complex operations and scattered configurations.
By deploying the application container management system and log collector resources on a public server and configuring the application custom startup script, the download and automatic configuration of log collector resources is achieved without modifying existing application templates or repackaging the image.
It reduces the workload of changes, reduces the operation and maintenance costs, reduces the error risk that human operations may bring, realizes timely collection of log data, and facilitates the maintenance and update of log collectors.
Smart Images

Figure CN119676105A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of cloud computing and financial technology, and in particular to an automated log collection method, device, computer equipment and storage medium. Background Art
[0002] In the field of financial technology, automated log collection is crucial. It can collect log data of financial transaction systems in real time, including transaction requests, transaction results, abnormal information, etc. By analyzing log data, financial institutions can conduct transaction supervision, user analysis, and system monitoring. They can also discover potential transaction risks, such as fraudulent transactions, abnormal transaction patterns, etc., and take corresponding risk control measures.
[0003] To achieve the acquisition of large amounts of log data, automated log collection is usually performed based on application containers on cloud computing platforms, such as K8S (full name: Kubernetes) containers. Existing log collection within K8S usually uses the ELK (Elasticsearch, Logstash, Kibana) technology stack. The specific methods include: deploying DaemonSet on each K8S node, or adding a Filebeat Sidecar container to each application container, or adding a Filebeat initialization container to the application deployment template. However, these methods have the following shortcomings.
[0004] Large amount of solution changes: Existing application templates need to be extensively modified, especially for systems with a large number of stock applications, the workload of the changes is huge.
[0005] Complex operation and high risk: Manually configuring the Filebeat Sidecar container or initializing the container is very complicated and prone to configuration errors, posing potential security risks to production applications.
[0006] Configuration dispersion: For the Filebeat Sidecar container or initialization container solution, the filebeat configuration is dispersed in the templates of each container, which is not easy to maintain and update. Summary of the invention
[0007] The present invention provides an automated log collection method, device, computer equipment and storage medium to solve the technical problems of existing automated log collection methods, such as large amount of scheme changes, complex operation, high risk and scattered configuration.
[0008] First, an automated log collection method is provided, including:
[0009] Deploy application container management system and log collector resources on public servers;
[0010] Configuring a custom application startup script on the application container management system;
[0011] Execute the application custom startup script;
[0012] Download the log collector resource according to the application custom startup script;
[0013] The log collector is started according to the application custom startup script and the log collector resources.
[0014] In a second aspect, an automated log collection device is provided, including:
[0015] Deployment module, deploy application container management system and log collector resources on public servers;
[0016] A configuration module is used to configure a custom application startup script on the application container management system;
[0017] A startup module executes the application custom startup script;
[0018] A download module, downloading the log collector resource according to the application custom startup script;
[0019] The collection module starts the log collector according to the application custom startup script and the log collector resources.
[0020] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned automated log collection method when executing the computer program.
[0021] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned automated log collection method are implemented.
[0022] Compared with the prior art, the present invention has the following beneficial effects: the present invention realizes the download of log collector resources by applying a custom startup script, thereby realizing automatic configuration and startup of the log collector, without modifying the existing application template or repackaging the image, and only needs to configure the custom startup script of the application, thereby reducing the workload of modification, and is suitable for systems with a large number of existing applications; the log collector is configured and started when the application is started, and the automatic startup of the log collector can be realized without manual intervention, thereby realizing timely collection of log data, reducing operation and maintenance costs, and reducing the risk of errors that may be caused by human operations; the resources related to the log collector are uniformly configured on a public server, which is conducive to centralized resource management and convenient for maintenance and updating of the log collector.
[0023] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a schematic diagram of an application environment of an automated log collection method in one embodiment of the present invention;
[0025] Figure 2 It is a flow chart of an automated log collection method in one embodiment of the present invention;
[0026] Figure 3 yes Figure 2 A schematic flow chart of a specific implementation of step S20;
[0027] Figure 4 yes Figure 2 A schematic flow chart of a specific implementation of step S40;
[0028] Figure 5 yes Figure 2 A schematic flow chart of a specific implementation of step S50;
[0029] Figure 6 yes Figure 5 A schematic flow chart of a specific implementation of step S51;
[0030] Figure 7 is a structural schematic diagram of an automated log collection device in one embodiment of the present invention;
[0031] Figure 8 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0032] Fig. 9 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described in detail in conjunction with the accompanying drawings and specific implementation methods. The technical solution in the embodiment of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. 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.
[0034] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0035] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0036] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0037] See also Figure 1 and Figure 2 , Figure 1 Schematic diagram of the application scenario of the automated log collection method provided for the embodiment of the present invention. Public server: deployed with application container management system and log collector resources. Among them, the application container management system runs on the public server and is used to manage and schedule application containers; the application container is the carrier for running applications. By using container technology, developers can easily deploy applications to any platform that supports container operation without worrying about the problems caused by environmental differences; the application is used to execute specific business logic and generate log data; the log collector: runs in the application container where the corresponding application is located, as an independent process, for collecting the log data of the corresponding application. Client: used to install and run the application. The application custom startup script of this embodiment is configured in the application container management system and executed when the application container is started. It can start the application, download the log collector resources and start the log collector process. The log collector is responsible for collecting the log data generated by the application and sending it to the specified log storage or analysis system. The present invention is described in detail below through specific embodiments.
[0038] See also Figure 2 As shown, Figure 2 A schematic flow chart of an automated log collection method provided by an embodiment of the present invention. The automated log collection method comprises the following steps:
[0039] S10: Deploy application container management system and log collector resources on a public server.
[0040] Deploying log collector resources on a public server in a unified manner helps to centrally manage resources and facilitates the maintenance and updating of log collectors. It can also achieve dynamic allocation and expansion of log collector resources through virtualization or containerization technology, which is conducive to flexible adjustment of log collector resource configuration when the amount of logs increases or the collection requirements change. Deploying log collector resources on a public server is conducive to building a unified log storage and analysis platform, which can store log data from different applications, different servers or different geographical locations together, and perform unified analysis and processing, so as to quickly mine valuable information in log data. At the same time, it is convenient for subsequent application of custom scripts to download log collector resources, so as to realize the association of log collectors with multiple applications with minor changes.
[0041] The log collector resources include: log collector program, log collector configuration file and log collector startup script.
[0042] The log collector program is responsible for executing the task of capturing log data. The log collector configuration file defines the specific rules for log data collection, such as log path, format, filtering conditions, etc. The log collector startup script is used to automatically load the configuration file, pass the rules to the log collector program and start the collector program. The three work together to ensure efficient, accurate and flexible configuration of log data collection to meet the diverse financial business decision support needs.
[0043] In this embodiment, the application container management system is K8S. K8S is short for Kubernetes, which is an open source container orchestration platform designed by Google and donated to the Cloud Native Computing Foundation for maintenance. K8S can deploy applications with one click without manually configuring containers and dependencies, greatly simplifying the deployment process.
[0044] In this embodiment, the log collector is filebeat. Filebeat is a lightweight log forwarding tool. Its main function is to monitor the log files or pipes under the specified path in real time, such as the / var / log directory, Docker log, etc., track the new content or rolling status of the file, and read the log events according to the predefined reading mode to avoid duplication or omission. It can forward the log data to the target system such as Elasticsearch, Logstash, Kafka, etc. Compared with Logstash, filebeat has the advantages of low resource consumption and easy deployment.
[0045] S20: configuring an application custom startup script on the application container management system.
[0046] The application custom startup script of this embodiment is used to start the application process, and can download the log collector resources and start the log collector process while starting the application. Only by customizing the application custom startup script, the application can be closely associated with the log collection system when it is started, and the automatic startup of the log collector can be realized without manual intervention, thereby realizing the timely collection of log data, reducing the operation and maintenance costs, reducing the risk of errors that may be caused by human operations, and helping to improve the monitoring and analysis capabilities of the entire financial business, providing timely and accurate data support for business decisions; in addition, the application custom startup script can also customize the configuration log collection rules according to the needs of different applications, further enhancing the pertinence and effectiveness of log collection.
[0047] In some embodiments of the present invention, Figure 3 As shown, a specific application custom startup script configuration solution is provided, in S20, that is, configuring the application custom startup script on the application container management system, specifically including the following steps S21-S22.
[0048] S21: Configuring an application startup script for starting an application in the application container management system.
[0049] The application startup script of this embodiment is used to start the application process to ensure that the application can be successfully started in the application container according to the predetermined method and parameters. The application startup script contains key information such as the operating environment configuration, dependency loading, and startup parameter setting required by the application.
[0050] In this embodiment, the application startup script is a shell script. Shell script is a scripting language based on Unix / Linux system, with concise and clear syntax, and can call system commands and tools, combined with programming structures such as conditional judgment and loop control, to achieve complex logical processing, so that shell scripts have high flexibility in configuring application startup parameters, loading dependencies, setting the operating environment, etc.; In addition, shell scripts can be easily integrated with other system components and services, such as interacting with the operating system and other applications by calling system APIs, accessing environment variables, operating file systems, etc., which helps to automatically download and configure log collector resources while starting the application, and realize the automation of log collection; Shell scripts also have good portability, as long as the target system supports the corresponding shell interpreter (such as bash, sh, etc.), shell scripts can be run, so that shell scripts have a wide range of application scenarios in different operating systems and environments; Through reasonable permission settings and script content review, shell scripts can ensure the security and controllability of the application startup process.
[0051] S22: Add the configuration information and startup command of the log collector to the application startup script to obtain the application custom startup script.
[0052] Step S22 realizes the association between the application and the log collector. By adding the configuration information of the log collector, it is ensured that the log collector can improve or update the log data collection rules to accurately collect the log data generated by the application; by embedding the startup command in the application startup script, the log collector can be automatically started when the application starts, and the log data can be collected in time without manual intervention, which improves the efficiency and accuracy of log collection.
[0053] S30: Execute the application customized startup script.
[0054] Execute the application custom startup script to start the corresponding application, such as the application related to the trading system. At the same time, it helps to trigger the automatic deployment and startup of the log collector to collect a large amount of transaction log data.
[0055] S40: Download the log collector resource according to the application customized startup script.
[0056] The application custom startup script contains the configuration information of the log collector. When the application starts, downloading the log collector resource helps to improve or update the configuration information in the log collector configuration file so that the log collector can be associated with the corresponding application and accurately obtain the application's log data.
[0057] In some embodiments of the present invention, Figure 4 As shown, a specific log collector resource downloading solution is provided. In S40, the log collector resource is downloaded according to the application custom startup script, which specifically includes the following steps S41-S42.
[0058] S41: searching for the corresponding log collector configuration file on the public server according to the configuration information.
[0059] S42: Download the log collector configuration file.
[0060] For steps S41-S42, according to the configuration information provided in the application custom startup script, the log collector configuration file matching the current application is quickly searched on the public server and downloaded, ensuring the accuracy and pertinence of the configuration file.
[0061] S50: Start the log collector according to the application custom startup script and the log collector resources.
[0062] The application's custom startup script provides configuration information and startup commands for the log collector, implements automatic startup of the log collector, and ensures that the log collector can accurately collect log data generated by the application according to predetermined rules.
[0063] In some embodiments of the present invention, Figure 5 As shown, a specific log collector startup solution is provided. In S50, the log collector is started according to the application custom startup script and the log collector resources, which specifically includes the following steps S51-S57.
[0064] S51: Update the configuration information into the log collector configuration file to obtain an updated log collector configuration file.
[0065] By updating the configuration information of the log collector configuration file, it is ensured that the collection rules accurately match the current application, laying a solid foundation for subsequent log collection work. This method can reduce the impact of configuration errors. Even if there are errors related to the startup of the log collector in the application's custom startup script, it only affects the log collector process itself and will not interfere with the running logic of the corresponding application and application container, reducing the impact of configuration errors.
[0066] In some embodiments of the present invention, Figure 6 As shown, a specific log collector configuration file update solution is provided, S51, that is, updating the configuration information to the log collector configuration file to obtain an updated log collector configuration file, specifically including the following steps S511-S512.
[0067] S511: Collect key environment variables of the configuration information.
[0068] The key environment variables of this embodiment include, but are not limited to: application name, log path, log level, filtering rules, etc. Key environment variables are crucial to the configuration of the log collector, determining the scope, accuracy and format of log collection, and ensuring the accuracy and pertinence of log data collection.
[0069] S512: Replace the placeholder in the log collector configuration file with the key environment variable to obtain an updated log collector configuration file.
[0070] By using key environment variables to replace placeholders in the log collector configuration file, a log collector configuration file that matches the current application environment is generated, which enables dynamic updating and customized configuration of the configuration file, ensuring that the log collector can accurately collect log data according to the most appropriate rules, thereby improving the flexibility and efficiency of log collection.
[0071] S52: The application-defined startup script triggers the startup command to execute the log collector startup script.
[0072] Applying a custom startup script to trigger the startup command automatically promotes the execution of the log collector startup script without manual intervention, thus improving the startup efficiency of the log collector.
[0073] S53: The log collector startup script extracts parameters and information of the updated log collector configuration file.
[0074] S54: The log collector startup script loads the parameters and information of the updated log collector configuration file into the log collector program.
[0075] S55: The log collector startup script starts the log collector program.
[0076] For steps S53-S55, the log collector startup script responds to the startup command, and then extracts the parameters and information of the updated configuration file to load the log data collection rules into the log collector program, providing a key guarantee for the correct operation of the log collector program.
[0077] S56: The log collector program is initialized according to the parameters and information of the updated log collector configuration file.
[0078] S57: Detect whether the log collector is started correctly, if so, start collecting logs, if not, perform error processing.
[0079] For steps S56-S57, if the log collector is started correctly, it will start collecting log data immediately, and collect application log data according to the log data collection rules in the updated log collector configuration file to meet the real-time monitoring needs of financial services; if the log collector fails to start, it will enter the error handling process, including checking the validity of the configuration file, restarting the log collector program, recording error information and notifying the operation and maintenance personnel, so as to quickly locate the cause of the problem and take corresponding measures to ensure the normal operation of the log collection system.
[0080] It can be seen that in the above scheme, the download of log collector resources is realized by applying a custom startup script, thereby realizing the automatic configuration and startup of the log collector. There is no need to modify the existing application template or repackage the image. Only the custom startup script of the application needs to be configured, which reduces the workload of modification and is suitable for systems with a large number of stock applications. When the application is started, the log collector is configured and started, and the automatic startup of the log collector can be realized without manual intervention, thereby realizing the timely collection of log data, reducing the operation and maintenance costs, and reducing the risk of errors that may be caused by manual operations. The resources related to the log collector are uniformly configured on a public server, which is conducive to centralized resource management and convenient for the maintenance and update of the log collector. The automatic log collection method of the present invention provides strong support for the timely monitoring of financial data and the effective management of financial services.
[0081] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0082] In one embodiment, the present invention provides an automated log collection device, which corresponds one-to-one to the automated log collection method in the above embodiment. Figure 7 As shown, the automatic log collection device includes. The detailed description of each functional module is as follows:
[0083] The deployment module 101 deploys the application container management system and log collector resources on a public server.
[0084] The configuration module 102 configures an application custom startup script on the application container management system.
[0085] The startup module 103 executes the application-defined startup script.
[0086] The download module 104 downloads the log collector resource according to the application custom startup script.
[0087] The collection module 105 starts the log collector according to the application custom startup script and the log collector resources.
[0088] In one embodiment, the log collector resources include: a log collector program, a log collector configuration file, and a log collector startup script.
[0089] In one embodiment, the configuration module 102 is specifically configured to:
[0090] Configuring an application startup script for starting an application in the application container management system;
[0091] The configuration information and startup command of the log collector are added to the application startup script to obtain the application custom startup script.
[0092] In one embodiment, the download module 104 is specifically configured to:
[0093] According to the configuration information, searching for the corresponding log collector configuration file on the public server;
[0094] Download the log collector configuration file.
[0095] In one embodiment, the acquisition module 105 is specifically used for:
[0096] Update the configuration information to the log collector configuration file to obtain an updated log collector configuration file;
[0097] The application customized startup script triggers the startup command to execute the log collector startup script;
[0098] The log collector startup script extracts parameters and information of the updated log collector configuration file;
[0099] The log collector startup script loads the parameters and information of the updated log collector configuration file into the log collector program;
[0100] The log collector startup script starts the log collector program;
[0101] The log collector program is initialized according to the parameters and information of the updated log collector configuration file;
[0102] Check whether the log collector is started correctly, if so, start collecting logs, if not, perform error processing.
[0103] In one embodiment, the updating of the configuration information to the log collector configuration file to obtain an updated log collector configuration file is specifically:
[0104] Collect key environment variables of the configuration information;
[0105] The key environment variables are used to replace the placeholders in the log collector configuration file to obtain an updated log collector configuration file.
[0106] For the specific definition of the automated log collection device, please refer to the definition of the automated log collection method above, which will not be repeated here. Each module in the above-mentioned automated log collection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0107] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps of the server of an automated log collection method are realized.
[0108] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, the functions or steps of the client side of an automated log collection method are implemented.
[0109] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0110] Deploy application container management system and log collector resources on public servers;
[0111] Configuring a custom application startup script on the application container management system;
[0112] Execute the application custom startup script;
[0113] Download the log collector resource according to the application custom startup script;
[0114] The log collector is started according to the application custom startup script and the log collector resources.
[0115] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant description in the aforementioned method embodiment. In order to avoid repetition, they will not be described one by one here.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0117] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0118] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. The automated log collection method is characterized by: include: Deploy application container management system and log collector resources on public servers; Configuring a custom application startup script on the application container management system; Execute the application custom startup script; Download the log collector resource according to the application custom startup script; The log collector is started according to the application custom startup script and the log collector resources.
2. The automated log collection method according to claim 1, characterized in that: The log collector resources include: a log collector program, a log collector configuration file, and a log collector startup script.
3. The automated log collection method according to claim 2, characterized in that: The configuring of the application custom startup script on the application container management system includes: Configuring an application startup script for starting an application in the application container management system; The configuration information and startup command of the log collector are added to the application startup script to obtain the application custom startup script.
4. The automated log collection method according to claim 3, characterized in that: The downloading of the log collector resource according to the application customized startup script includes: According to the configuration information, searching for the corresponding log collector configuration file on the public server; Download the log collector configuration file.
5. The automated log collection method according to claim 4, characterized in that: The starting the log collector according to the application custom startup script and the log collector resource includes: Update the configuration information to the log collector configuration file to obtain an updated log collector configuration file; The application customized startup script triggers the startup command to execute the log collector startup script; The log collector startup script extracts parameters and information of the updated log collector configuration file; The log collector startup script loads the parameters and information of the updated log collector configuration file into the log collector program; The log collector startup script starts the log collector program.
6. The automated log collection method according to claim 5, characterized in that: The step of updating the configuration information to the log collector configuration file to obtain an updated log collector configuration file includes: Collect key environment variables of the configuration information; The key environment variables are used to replace the placeholders in the log collector configuration file to obtain an updated log collector configuration file.
7. The automated log collection method according to claim 5, characterized in that: After the log collector startup script starts the log collector program, it also includes: The log collector program is initialized according to the parameters and information of the updated log collector configuration file; Check whether the log collector is started correctly, if so, start collecting logs, if not, perform error processing.
8. The automated log collection device is characterized by: include: Deployment module, deploy application container management system and log collector resources on public servers; A configuration module is used to configure a custom application startup script on the application container management system; A startup module executes the application custom startup script; A download module, downloading the log collector resource according to the application custom startup script; The collection module starts the log collector according to the application custom startup script and the log collector resources.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the automated log collection method according to any one of claims 1 to 7 are implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the automated log collection method according to any one of claims 1 to 7 are implemented.