24 How Serverless Applications Manage Persistent Logging Data

24 How Serverless Applications Manage Persistent Logging Data #

Real-time Logs #

Image1.png

Firstly, SAE supports viewing the real-time logs of each Pod in the application instance group. When the application encounters exceptional situations, you can locate the problem by checking the real-time logs of the Pods. During the runtime of the application, you can conveniently see the real-time logs of the application instances under the “Console - Log Management - Real-time Logs” submenu.

File Logs #

Image2.png

SAE collects business file logs (excluding stdout and stderr logs) and inputs them into SLS for limitless log viewing, self-aggregation, log analysis, and convenient integration of business logs. The logs are billed based on usage.

You can configure the log collection service when deploying the application, and enter the logs source that needs to be collected. For scenarios involving rolling logs, you can use wildcards to solve the issue.

Image3.png

After the configuration is completed, you can conveniently see the collected file logs under the “Console - Log Management - File Logs” submenu.

NAS Persistent Storage #

Image4.png

As the data stored in containers is non-persistent, SAE supports NAS storage to address the issue of data persistence in application instances and data sharing among instances.

You can configure persistent storage by deploying the application, selecting the created NAS, and entering the corresponding mounting path in the container.

Image9.png

After the configuration is completed, you can use the cat /proc/mount | grep nfs command to check if the mounting is successful. Alternatively, you can prepare two application instances, A and B, and mount NAS on each of them. Execute the write command echo "hello" > tmp.txt on A, and then execute the read command cat tmp.txt on B. If B can read the “hello” written by A, it indicates that the NAS mounting is successful.