Application log real-time viewing method and system based on Akka distributed communication and medium

By adopting the Akka distributed communication framework in the log management system, log collection, processing and real-time viewing functions are integrated into the collaborative Actor, the problems of insufficient complexity and scalability of traditional log management solutions are solved, and the effects of simplifying deployment, reducing operation and maintenance costs and improving real-time and scaling are achieved.

CN120050161APending Publication Date: 2025-05-27山东浪潮智慧医疗科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411894513.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Traditional log management solutions require the deployment and maintenance of multiple independent components, which increases the complexity and operation and maintenance costs of the system, and may experience performance bottlenecks when facing high concurrent requests, and are limited in scalability.

Method used

Using Akka distributed communications approach, the creation of log collection, processing and real-time viewing functions are integrated into a group of collaborative actors, simplifying the deployment and maintenance process of the system and supporting a distributed architecture to deal with high concurrent requests.

Benefits of technology

It simplifies system deployment and maintenance, reduces operation and maintenance costs, improves system scalability and real-time performance, and can effectively respond to high concurrent requests and large-scale log processing needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050161A_ABST
    Figure CN120050161A_ABST
Patent Text Reader

Abstract

The invention discloses an application log real-time viewing method and system based on Akka distributed communication and a medium, mainly relates to the technical field of log real-time viewing, and is used for solving the problem that a traditional log management scheme needs to deploy and maintain a plurality of independent components, so that the complexity and the operation and maintenance cost of the system are increased. In addition, there is a problem that expansibility is limited. Comprising the following steps: creating a log generation Actor corresponding to an Akka framework in each distributed system; acquiring an application log generated by the current distributed system through the log generation Actor, and uploading the application log to the log collection Actor through remote communication; processing the application log obtained by the log collection Actor through a preset processing program in the log processing Actor to obtain a processed log; and the WebSocket Actor receives the processed log, and the processed log is sent to each client through the WebSocket.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of real-time log viewing, and in particular, to a method, system, and medium for real-time viewing of application logs based on Akka distributed communication. Background Art

[0002] In modern distributed systems, application logs are an indispensable means for system operation and maintenance and troubleshooting. Logs record the running status, operation behaviors, and potential problems of the system, providing valuable "clues" for operation and maintenance personnel to help them quickly locate and solve various faults in the system. However, with the continuous expansion of the system scale and the increasing number of nodes, the real-time collection, processing, and display of logs face unprecedented challenges.

[0003] Traditional log management solutions, such as the ELK Stack (Elasticsearch Logstash Kibana) and Apache Kafka, do solve the problem of centralized log management to a certain extent. These solutions achieve the collection, storage, search, and analysis of log data through a distributed architecture, providing operation and maintenance personnel with log processing tools. However, at the same time, these solutions also bring new problems. Deploying and maintaining multiple independent components not only requires professional knowledge and skills but also increases the complexity of the system and operation and maintenance costs. Each component needs to be configured, monitored, and maintained separately, which undoubtedly increases the workload of operation and maintenance personnel.

[0004] Therefore, there is an urgent need for a method, system, and medium for real-time viewing of application logs based on Akka distributed communication to solve the problem that traditional log management solutions require deploying and maintaining multiple independent components, increasing the complexity of the system and operation and maintenance costs. In addition, existing solutions may experience performance bottlenecks when facing high-concurrency requests, and their scalability is limited. Summary of the Invention

[0005] In view of the above deficiencies of the prior art, this application provides a method, system, and medium for real-time viewing of application logs based on Akka distributed communication to solve the problem that traditional log management solutions require deploying and maintaining multiple independent components, increasing the complexity of the system and operation and maintenance costs. In addition, existing solutions may experience performance bottlenecks when facing high-concurrency requests, and there is a problem of limited scalability.

[0006] In a first aspect, this application provides a method for real-time viewing of application logs based on Akka distributed communication, the method comprising: Based on the Akka framework, create a log collection Actor, a log processing Actor, and a WebSocket Actor; create a log generation Actor corresponding to the Akka framework in each distributed system; obtain the application logs generated by the current distributed system through the log generation Actor, and upload the application logs to the log collection Actor through remote communication; process the application logs obtained by the log collection Actor through the preset processing program in the log processing Actor to obtain the processed logs; the WebSocket Actor receives the processed logs and sends the processed logs to each client through WebSocket.

[0007] In an implementation manner of this application, based on the Akka framework, create a log collection Actor, a log processing Actor, and a WebSocket Actor, which specifically includes: Define a LogCollectorActor class, inherit from Actor, and implement the receive method to process the received messages; in the receive method, match the messages of the LogMessage type and forward them to the log processing Actor; Define a props method for LogCollectorActor to complete the creation of the log collection Actor; Define a LogProcessorActor class, also inherit from Actor, and implement the receive method; In the receive method, receive and process the log messages, then call the WebSocket Actor to send out the processed logs, and obtain the specific processing logic program for processing the logs; Define a props method for LogProcessorActor to complete the creation of the log processing Actor; Define a WebSocketActor class, inherit from Actor, and implement the receive method; In the receive method, process the ProcessedLog messages from the log processing Actor and send them to the client through the WebSocket connection.

[0008] In an implementation manner of this application, obtain the specific processing logic program for processing the logs, which specifically includes: Obtain or modify the specific processing logic program for processing the logs through the backend interface.

[0009] In an implementation manner of this application, create a log generation Actor corresponding to the Akka framework in each distributed system, which specifically includes: Define a LogGeneratorActor class on each distributed node, which inherits from Actor; In the preStart method of LogGeneratorActor, set up a monitor to monitor the application logs generated by the current distributed system, and send the generated application logs to the log collection Actor; Define a props method for LogGeneratorActor and configure the remote deployment information to complete the creation of the log generation Actor corresponding to the Akka framework; among them, the remote deployment information includes the remote path of the log collection Actor.

[0010] In an implementation manner of the present application, before the WebSocket Actor receives and processes the post-processed logs and sends the post-processed logs to each client through the WebSocket, the method further includes: Configure a set of clients and send the post-processed logs to each client within the set of clients through the WebSocket.

[0011] In a second aspect, the present application provides a real-time viewing system for application logs based on Akka distributed communication. The system includes: A first creation module for creating a log collection Actor, a log processing Actor, and a WebSocket Actor based on the Akka framework; a second creation module for creating an Akka framework corresponding log generation Actor in each distributed system; the log generation Actor for obtaining the application logs generated by the current distributed system and uploading the application logs to the log collection Actor through remote communication; the log processing Actor for processing the application logs obtained by the log collection Actor through a preset processing program to obtain post-processed logs; the WebSocket Actor for receiving the post-processed logs and sending the post-processed logs to each client through the WebSocket.

[0012] In an implementation manner of the present application, the first creation module includes a log processing creation unit, a log collection creation unit, and a WebSocket creation unit; Among them, the log collection creation unit is used to define a LogCollectorActor class that inherits from Actor and implements the receive method to process the received messages; in the receive method, match the messages of the LogMessage type and forward them to the log processing Actor; Define a props method for LogCollectorActor to complete the creation of the log collection Actor; A log processing creation unit is used to define a LogProcessorActor class, which also inherits from Actor and implements the receive method; In the receive method, it receives and processes log messages, then calls the WebSocket Actor to send the processed logs, and obtains the specific processing logic program for processing logs; Define a props method for LogProcessorActor to complete the creation of the log processing Actor; A WebSocket creation unit is used to define a WebSocketActor class, which inherits from Actor and implements the receive method; In the receive method, it processes the ProcessedLog message from the log processing Actor and sends it to the client through the WebSocket connection.

[0013] In an implementation manner of the present application, the second creation module includes a log generation creation unit, The log generation creation unit is used to define a LogGeneratorActor class on each distributed node, which inherits from Actor; In the preStart method of LogGeneratorActor, set a monitor to monitor the application logs generated by the current distributed system, and send the generated application logs to the log collection Actor; Define a props method for LogGeneratorActor and configure the remote deployment information to complete the creation of the log generation Actor corresponding to the Akka framework; among them, the remote deployment information includes the remote path of the log collection Actor.

[0014] In an implementation manner of the present application, the WebSocket Actor includes a client configuration unit, which is used to configure a set of clients and send the processed logs to each client in the set of clients through the WebSocket.

[0015] In a third aspect, the present application provides a non-volatile computer storage medium, on which computer instructions are stored, and when the computer instructions are executed, they implement an application log real-time viewing method based on Akka distributed communication as described in any one of the above.

[0016] Those skilled in the art can understand that the present application has at least the following beneficial effects: The present application provides a method, system and medium for real-time viewing of application logs based on Akka distributed communication. Traditional log management solutions such as ELK Stack and Apache Kafka require the deployment and maintenance of multiple independent components, each with its specific configuration, monitoring and maintenance requirements. However, the solution proposed in the present application integrates log collection, processing and real-time viewing functions into a group of cooperating Actors through the Akka framework, simplifying the system deployment and maintenance process. That is, the present application solves the problem that traditional log management solutions need to deploy and maintain multiple independent components, increasing the complexity of the system and the operation and maintenance costs. In addition, the present application supports a distributed architecture and can handle high-concurrency requests and large-scale log processing requirements. By adding more log generation Actors, log processing Actors or WebSocket Actors, the system can be horizontally scaled to meet the growing business needs. It solves the problem that existing solutions may experience performance bottlenecks and limited scalability when facing high-concurrency requests. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 It is a flowchart of a method for real-time viewing of application logs based on Akka distributed communication provided by an embodiment of the present application.

[0019] Figure 2 It is a schematic diagram of the internal structure of a system for real-time viewing of application logs based on Akka distributed communication provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] Those skilled in the art should understand that the embodiments described below are only the preferred embodiments of the present disclosure, and do not mean that the present disclosure can only be implemented through these preferred embodiments. The preferred embodiments are only used to explain the technical principles of the present disclosure and are not used to limit the protection scope of the present disclosure. Based on the preferred embodiments provided by the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts should still fall within the protection scope of the present disclosure.

[0021] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.

[0022] This application provides a method, system and medium for real-time viewing of application logs based on Akka distributed communication. By utilizing the high-concurrency processing ability, distributed architecture, fault tolerance and self-healing characteristics of Akka, it realizes the real-time collection, processing and display of application logs distributed on different nodes. The system includes a log generation node, a log collection Actor, a log processing Actor and a WebSocket Actor, and pushes the logs to the client in real time through a WebSocket link to achieve real-time monitoring and analysis of application logs. It has the advantages of high efficiency, reliability and scalability, and is suitable for log management and monitoring of large-scale distributed systems.

[0023] The following details the technical solutions proposed in the embodiments of this application with reference to the accompanying drawings.

[0024] The embodiment provides a method for real-time viewing of application logs based on Akka distributed communication, as Figure 1 shown. The method provided in the embodiments of this application mainly includes the following steps: Step 110: Based on the Akka framework, create a log collection Actor, a log processing Actor and a WebSocket Actor.

[0025] In some embodiments, creating a log collection Actor specifically includes: Define a LogCollectorActor class that inherits from Actor and implements the receive method to process the received messages; in the receive method, match messages of the LogMessage type and forward them to the log processing Actor; define a props method for LogCollectorActor to complete the creation of the log collection Actor.

[0026] In some embodiments, creating a log processing Actor specifically includes: Define a LogProcessorActor class that also inherits from Actor and implements the receive method; In the receive method, receive and process the log messages, then call the WebSocket Actor to send the processed logs, and obtain the specific processing logic program for processing the logs. Define a props method for the LogProcessorActor to complete the creation of the log processing Actor. It should be noted that the specific processing logic program for obtaining the processed logs can specifically be: obtaining or modifying the specific processing logic program for processing the logs through the backend interface.

[0027] In some embodiments, creating the WebSocket Actor specifically includes: Define a WebSocketActor class that inherits from Actor and implements the receive method; in the receive method, process the ProcessedLog message from the log processing Actor and send it to the client through the WebSocket connection.

[0028] Step 120: Create a log generation Actor corresponding to the Akka framework in each distributed system.

[0029] This step can specifically be: Define a LogGeneratorActor class on each distributed node that inherits from Actor; in the preStart method of LogGeneratorActor, set up a monitor to monitor the application logs generated by the current distributed system and send the generated application logs to the log collection Actor; define a props method for LogGeneratorActor and configure the remote deployment information to complete the creation of the log generation Actor corresponding to the Akka framework; among them, the remote deployment information includes the remote path of the log collection Actor.

[0030] It should be noted that the remote deployment information includes configuring the remote communication settings of Akka in the application.conf file of each node (distributed system), including canonical.hostname, canonical.port, and seed-nodes, etc. Ensure that all nodes can communicate with each other through the configured addresses and ports.

[0031] Step 130: Obtain the application logs generated by the current distributed system through the log generation Actor and upload the application logs to the log collection Actor through remote communication.

[0032] This step can be specifically as follows: Start the Akka system on each distributed node and create an instance of LogGeneratorActor. Start the Akka system on the log collection node and create instances of LogCollectorActor and LogProcessorActor. Start the WebSocket server to listen for client connections. The client connects to the server via WebSocket and starts receiving the processed log messages. Use the logging function of Akka (such as ActorLogging) to record the behavior and status of the Actor for easy monitoring and debugging. Monitor the running status and performance metrics of the Actor system through the management tools of Akka (such as Akka Management, debugging tools of AkkaTyped, etc.). Adjust the frequency and strategy of log generation, processing, and transmission as needed to optimize the system performance.

[0033] Step 140: Process the application logs obtained by the log collection Actor through the preset handlers in the log processing Actor to obtain the processed logs.

[0034] It should be added that the preset handlers include but are not limited to the following aspects: 1. Log filtering: In practical applications, not all log messages are of concern to the operation and maintenance personnel. The log processing Actor can filter the log messages according to the preset rules or conditions, and only retain those important and business-related log information. The filtering rules can be defined based on multiple conditions such as log levels (such as INFO, WARN, ERROR), keyword matching, timestamp range, etc. to meet the log filtering requirements in different scenarios.

[0035] 2. Log formatting: Original log messages often appear in different formats and styles, which may cause difficulties for operation and maintenance personnel in reading and understanding. The log processing Actor can uniformly format these messages to conform to specific output standards. The formatting operations can include unified formatting of timestamps, clear identification of log levels, normalization of message content, etc. to ensure the clarity and readability of log messages.

[0036] 3. Log enhancement: In some cases, the original log messages may lack sufficient context information, making it difficult for operation and maintenance personnel to quickly locate problems. The log processing Actor can add additional context information to the log messages, such as log source, system status, associated events, etc. to enhance the practicality of the logs.

[0037] 4. Log aggregation: For certain specific business scenarios, multiple log messages may jointly describe a complete event or problem. The log processing Actor can aggregate these related log messages to form a more complete and meaningful log record. The aggregation operation can be based on various factors such as time window, event type, log content, etc., to help the operation and maintenance personnel better understand the business operation status.

[0038] 5. Log forwarding: The processed log messages need to be sent to the client for display in real time through the WebSocket Actor. The log processing Actor is responsible for encapsulating the processed log messages into a specific format and sending them to the mailbox of the WebSocket Actor. The forwarding process needs to ensure the integrity and order of the log messages to avoid the situation of log disorder or loss on the client side.

[0039] Step 150: The WebSocket Actor receives the processed log and sends the processed log to each client through the WebSocket.

[0040] In addition, this application can configure the client set by itself, and the client set contains each client for log acquisition. Furthermore, the processed log is sent to each client in the client set through the WebSocket.

[0041] Based on the foregoing description, it can be seen that this embodiment uses the Actor model of Akka to efficiently process a large number of concurrent log requests, ensuring the real-time nature and order of the logs. It supports distributed deployment, can process the logs distributed on different nodes, and realizes the centralized management and display of the logs. Through the supervision strategy of Akka, when a certain node fails, the faulty Actor can be automatically restarted to ensure stability and reliability. Using WebSocket technology, the processed log messages are pushed to the client in real time to realize the real-time monitoring and analysis of the logs.

[0042] In addition to this, this application Figure 2 This is a real-time viewing system for application logs based on Akka distributed communication provided by the embodiment of this application. As Figure 2 shown, the system provided by the embodiment of this application mainly includes: The first creation module 210 is used to create a log collection Actor 240, a log processing Actor 250, and a WebSocket Actor 260 based on the Akka framework.

[0043] The first creation module 210 includes a log processing creation unit, a log collection creation unit, and a WebSocket creation unit.

[0044] Among them, the log collection creation unit is used to define a LogCollectorActor class, which inherits from Actor and implements the receive method to process the received messages. In the receive method, it matches messages of the LogMessage type and forwards them to the log processing Actor250. A props method is defined for LogCollectorActor to complete the creation of the log collection Actor240.

[0045] It should be added that the definition operations involved in this application are all preset custom operations.

[0046] The log processing creation unit is used to define a LogProcessorActor class, which also inherits from Actor and implements the receive method. In the receive method, it receives and processes log messages, then calls the WebSocket Actor260 to send the processed logs, and obtains the specific processing logic program for processing the logs. A props method is defined for LogProcessorActor to complete the creation of the log processing Actor250.

[0047] It should be added that the specific processing logic program includes but is not limited to the following aspects: 1. Log filtering: In practical applications, not all log messages are of concern to the operation and maintenance personnel. The log processing Actor can filter log messages according to preset rules or conditions, and only retain those important and business-related log information. The filtering rules can be defined based on various conditions such as log levels (such as INFO, WARN, ERROR), keyword matching, timestamp range, etc. to meet the log filtering requirements in different scenarios.

[0048] 2. Log formatting: Original log messages often appear in different formats and styles, which may cause difficulties for operation and maintenance personnel in reading and understanding. The log processing Actor can uniformly format these messages to make them conform to specific output standards. The formatting operations can include unified formatting of timestamps, clear identification of log levels, normalization of message content, etc. to ensure the clarity and readability of log messages.

[0049] 3. Log enhancement: In some cases, the original log messages may lack sufficient context information, making it difficult for operation and maintenance personnel to quickly locate problems. The log processing Actor can add additional context information to the log messages, such as log sources, system status, associated events, etc., to enhance the practicality of the logs.

[0050] 4. Log Aggregation: For certain specific business scenarios, multiple log messages may jointly describe a complete event or problem. The log processing Actor can aggregate these related log messages to form a more complete and meaningful log record. The aggregation operation can be based on various factors such as time window, event type, log content, etc., to help operation and maintenance personnel better understand the business operation status.

[0051] 5. Log Forwarding: The processed log messages need to be sent to the client for display in real time through the WebSocket Actor. The log processing Actor is responsible for encapsulating the processed log messages into a specific format and sending them to the mailbox of the WebSocket Actor. The forwarding process needs to ensure the integrity and order of the log messages to avoid the situation of log disorder or loss on the client side.

[0052] The WebSocket creation unit is used to define a WebSocketActor class, which inherits from Actor and implements the receive method; in the receive method, it processes the ProcessedLog message from the log processing Actor 250 and sends it to the client through the WebSocket connection.

[0053] The second creation module 220 is used to create the log generation Actor 230 corresponding to the Akka framework in each distributed system.

[0054] The second creation module 220 includes a log generation creation unit. The log generation creation unit is used to define a LogGeneratorActor class on each distributed node, which inherits from Actor; in the preStart method of the LogGeneratorActor, set a monitor to monitor the application logs generated by the current distributed system, and send the generated application logs to the log collection Actor 240; define a props method for the LogGeneratorActor and configure the remote deployment information to complete the creation of the log generation Actor 230 corresponding to the Akka framework; among them, the remote deployment information includes the remote path of the log collection Actor 240.

[0055] The log generation Actor 230 is used to obtain the application logs generated by the current distributed system and upload the application logs to the log collection Actor 240 through remote communication.

[0056] More specifically, start the Akka system on each distributed node and create an instance of LogGeneratorActor. Start the Akka system on the log collection node and create instances of LogCollectorActor and LogProcessorActor. Start the WebSocket server and listen for client connections. The client connects to the server via WebSocket and starts receiving the processed log messages. Use Akka's logging functions (such as ActorLogging) to record the behavior and status of the Actor for easy monitoring and debugging. Monitor the running status and performance metrics of the Actor system through Akka's management tools (such as Akka Management, debugging tools for Akka Typed, etc.). Adjust the frequency and strategy of log generation, processing, and transmission as needed to optimize system performance.

[0057] The log processing Actor250 is used to process the application logs obtained by the log collection Actor240 through a preset handler to obtain the processed logs.

[0058] The WebSocket Actor260 is used to receive the processed logs and send the processed logs to each client via WebSocket.

[0059] The WebSocket Actor260 includes a client configuration unit for configuring a set of clients and sending the processed logs to each client within the set of clients via WebSocket.

[0060] Based on the foregoing description, it can be seen that this embodiment has at least the following beneficial effects: 1. Simplify deployment and maintenance: Integrated design: Traditional log management solutions such as ELK Stack and Apache Kafka require the deployment and maintenance of multiple independent components, each with its specific configuration, monitoring, and maintenance requirements. However, the solution proposed in this application integrates log collection, processing, and real-time viewing functions into a group of cooperating Actors through the Akka framework, simplifying the system deployment and maintenance process.

[0061] Reduce the requirement for professional knowledge: Since the Akka framework provides a highly abstracted and encapsulated communication mechanism, operation and maintenance personnel do not need to deeply understand the internal working principles of each component and only need to focus on the configuration and management of Akka, thus reducing the requirement for professional knowledge.

[0062] Unified Monitoring and Management: The Akka framework supports the unified monitoring and management of the Actor system, enabling operations and maintenance personnel to monitor the entire log processing flow on a single platform and improving operations and maintenance efficiency.

[0063] 2. Improve System Scalability: Distributed Architecture: The Akka framework itself supports a distributed architecture and can easily handle high-concurrency requests and large-scale log processing requirements. By adding more Log Generation Actors 230, Log Processing Actors 250, or WebSocket Actors 260, the system can be horizontally scaled to meet growing business needs.

[0064] Flexible Configuration and Customization: The Akka framework allows for the flexible configuration of the number, behavior, and processing logic of Actors according to actual needs. This flexibility enables the system to more easily adapt to different application scenarios and business requirements.

[0065] Modular Design: The solution proposed in this application adopts a modular design, and each Actor can be regarded as an independent module. This design approach makes the system easier to expand and modify, and also facilitates the addition of new functions.

[0066] 3. Enhanced Real-time Performance: Low-latency Communication: The Akka framework provides an efficient communication mechanism, enabling the Log Generation Actor 230 to send log data to the Log Collection Actor 240 in real time. After being processed by the Log Processing Actor 250, it is sent to the client in real time through the WebSocket Actor 260. This low-latency communication method ensures the real-time performance of log data.

[0067] Dynamic Processing and Display: Since the system supports real-time processing of log data and sends the processed logs to the client in real time through WebSocket, operations and maintenance personnel can view and analyze log data immediately, improving the efficiency of problem discovery and resolution.

[0068] 4. Improved Cost-effectiveness: Reduce Operations and Maintenance Costs: By simplifying the deployment and maintenance process, improving system scalability and real-time performance, the solution proposed in this application can significantly reduce operations and maintenance costs. Operations and maintenance personnel can manage log data more efficiently and reduce additional investments caused by system complexity and performance issues.

[0069] Enhance Business Value: Real-time viewing and analysis of log data are of great significance for business operations and decision-making. Through the solution proposed in this application, enterprises can discover problems, locate the causes, and take measures more quickly, thereby enhancing business value and customer satisfaction.

[0070] In summary, the real-time application log viewing method, system, and medium based on Akka distributed communication provided by this application have significant beneficial effects in aspects such as simplifying deployment and maintenance, improving system scalability, enhancing real-time performance, and increasing cost-effectiveness. These advantages make this solution an effective alternative to solve the problems existing in traditional log management solutions.

[0071] In addition, the embodiments of this application also provide a non-volatile computer storage medium, on which executable instructions are stored, and when the executable instructions are executed, a real-time application log viewing method based on Akka distributed communication as described above is implemented.

[0072] So far, the technical solutions of the present disclosure have been described in combination with multiple previous embodiments. However, it is easy for those skilled in the art to understand that the protection scope of the present disclosure is not limited to these specific embodiments. Without departing from the technical principle of the present disclosure, those skilled in the art can split and combine the technical solutions in the above-mentioned various embodiments, and can also make equivalent changes or replacements to the relevant technical features. Any changes, equivalent replacements, improvements, etc. made within the technical concept and / or technical principle of the present disclosure will fall within the protection scope of the present disclosure.

Claims

1. A method for viewing application logs in real time based on Akka distributed communication, characterized in that: The method comprises: Based on the Akka framework, create log collection actors, log processing actors, and WebSocket actors; Create log generation actors corresponding to the Akka framework in each distributed system; Obtain application logs generated by the current distributed system through the log generation actor, and upload the application logs to the log collection actor through remote communication; Through the preset processing program in the log processing Actor, the application log obtained by the log collection Actor is processed to obtain the processed log; WebSocket Actor receives the processed logs and sends them to each client through WebSocket.

2. The method for viewing application logs in real time based on Akka distributed communication according to claim 1, characterized in that: Based on the Akka framework, create log collection actors, log processing actors, and WebSocket actors, including: Define a LogCollectorActor class that inherits from Actor and implements the receive method to process received messages. In the receive method, match messages of the LogMessage type and forward them to the log processing Actor. Define a props method for LogCollectorActor to complete the creation of the log collection Actor; Define a LogProcessorActor class, which also inherits from Actor and implements the receive method; In the receive method, log messages are received and processed, and then the WebSocket Actor is called to send the processed logs and obtain the specific processing logic program for processing the logs. Define a props method for LogProcessorActor to complete the creation of the log processing Actor; Define a WebSocketActor class, inherit from Actor, and implement the receive method; In the receive method, the ProcessedLog message from the log processing Actor is processed and sent to the client through the WebSocket connection.

3. The method for viewing application logs in real time based on Akka distributed communication according to claim 2 is characterized in that: Obtain the specific processing logic program for processing logs, including: Through the back-end interface, obtain or modify the specific processing logic program for processing logs.

4. The method for viewing application logs in real time based on Akka distributed communication according to claim 1, characterized in that: Create the log generation actor corresponding to the Akka framework in each distributed system, including: Define a LogGeneratorActor class on each distributed node, which inherits from Actor; In the preStart method of LogGeneratorActor, set the monitor to monitor the application logs generated by the current distributed system and send the generated application logs to the log collection Actor; Define a props method for LogGeneratorActor and configure remote deployment information to complete the creation of the log generation Actor corresponding to the Akka framework; the remote deployment information includes the remote path of the log collection Actor.

5. The method for viewing application logs in real time based on Akka distributed communication according to claim 1, characterized in that: Before the WebSocket Actor receives the processed log and sends the processed log to each client through the WebSocket, the method further includes: Configure a client collection and send processed logs to each client in the client collection through WebSocket.

6. A real-time viewing system for application logs based on Akka distributed communication, characterized in that: The system comprises: The first creation module is used to create log collection Actor, log processing Actor and WebSocketActor based on the Akka framework; The second creation module is used to create the log generation actor corresponding to the Akka framework in each distributed system; The log generation actor is used to obtain the application logs generated by the current distributed system and upload the application logs to the log collection actor through remote communication; The log processing actor is used to process the application logs obtained by the log collection actor through a preset processing program to obtain the processed logs; WebSocket Actor is used to receive processed logs and send them to various clients through WebSocket.

7. The application log real-time viewing system based on Akka distributed communication according to claim 6 is characterized in that: The first creation module includes a log processing creation unit, a log collection creation unit, and a WebSocket creation unit; The log collection creation unit is used to define a LogCollectorActor class, which inherits from Actor and implements the receive method to process received messages. In the receive method, messages of the LogMessage type are matched and forwarded to the log processing Actor. Define a props method for LogCollectorActor to complete the creation of the log collection Actor; The log processing creation unit is used to define a LogProcessorActor class, which also inherits from Actor and implements the receive method; In the receive method, log messages are received and processed, and then the WebSocket Actor is called to send the processed logs and obtain the specific processing logic program for processing the logs. Define a props method for LogProcessorActor to complete the creation of the log processing Actor; The WebSocket creation unit is used to define a WebSocketActor class, which inherits from Actor and implements the receive method; In the receive method, the ProcessedLog message from the log processing Actor is processed and sent to the client through the WebSocket connection.

8. The application log real-time viewing system based on Akka distributed communication according to claim 6 is characterized in that: The second creation module includes a log generation creation unit, The log generation creation unit is used to define a LogGeneratorActor class on each distributed node, which inherits from Actor; In the preStart method of LogGeneratorActor, set the monitor to monitor the application logs generated by the current distributed system and send the generated application logs to the log collection Actor; Define a props method for LogGeneratorActor and configure remote deployment information to complete the creation of the log generation Actor corresponding to the Akka framework; the remote deployment information includes the remote path of the log collection Actor.

9. The application log real-time viewing system based on Akka distributed communication according to claim 6 is characterized in that: WebSocket Actor includes a client configuration unit, which is used to configure a client collection and send processed logs to each client in the client collection through WebSocket.

10. A non-volatile computer storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed, the method for viewing application logs in real time based on Akka distributed communication as described in any one of claims 1 to 5 is implemented.