Configuring a Log Policy of an Application
ServiceStage supports setting of application log policies. You can view related logs on the AOM console.
You can configure a log policy during or after application component deployment.
If no configuration is performed, the system collects standard application output logs by default.
Procedure
- Go to the log policy configuration page.
- To configure the application log policy during component configuration in the component deployment, go to 6.
- To configure the application log policy after the component is deployed, go to 2.
- Log in to ServiceStage and choose Application Management > Application List to view all applications.
- Click an application. The Overview page is displayed.
- On the Environment View tab, select an environment to view the application components that have been deployed in the environment.
- Click an application component. The Overview page is displayed. Choose Upgrade.
- Choose Advanced Settings > O&M Monitoring > Log Collection, click Add Log Policy, and set the parameters listed in the following table.
Parameter
Description
Storage Type
Select a storage type.
- HostPath: Mount a host path to a specified container path.
- Mounting Path: Logs are exported only to the container path. You do not need to mount the host path.
Host Path
This parameter is mandatory when Storage Type is set to HostPath.
Enter the log storage path on the host.
Docker Mounting
- Set Mounting Path: Enter the application path to which the data volume is mounted.
NOTICE:
- Do not mount a data volume to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects application startup. Otherwise, the files will be replaced, causing application startup exceptions. As a result, the application fails to be created.
- When the data volume is mounted to a high-risk directory, you are advised to use a low-permission account to start the application; otherwise, high-risk files on the host may be damaged.
- Set Extended Host Path.
- None: No extended path is configured.
- PodUID: Pod ID.
- PodName: Pod name.
- PodUID/ContainerName: Pod ID or container name.
- PodName/ContainerName: Pod name or container name.
- Set Aging Period.
- Hourly: Log files are scanned every hour. If the size of a log file exceeds 20 MB, the system compresses the log file to a historical file, dumps the historical file to the directory where the log file is stored, and clears the original log file.
- Daily: Log files are scanned once a day. If the size of a log file exceeds 20 MB, the system compresses the log file to a historical file, dumps the historical file to the directory where the log file is stored, and clears the original log file.
- Weekly: Log files are scanned once a week. If the size of a log file exceeds 20 MB, the system compresses the log file to a historical file, dumps the historical file to the directory where the log file is stored, and clears the original log file.
- Click Confirm.
- Complete the application log policy configuration.
- If the log policy is set during component configuration in the component deployment, click Next.
- If the log policy is set after the component is deployed, click Re-deployment.
After the configuration and deployment are complete, you can view run logs on the AOM console. For details, see Viewing Log Files.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot