On the Specify Logstore wizard page, set the parameters and click Next. In the Import Data section, click RegEx - Text Log. Step 2: Configure Logtail to collect logsĪfter you deploy the sidecar container, you need to configure Logtail in the Log Service console to collect logs. View logs in the Elastic Container Instance console Run the following command to query information about the pods: kubectl get pods -l app=nginx-log-sidecar-demoĮxpected output: NAME READY STATUS RESTARTS AGE name: stdlog # Collect standard outputs to the stdlog volume. Image: registry-vpc.$ # Collect text files to the emptyDir volume. Replace the placeholder variables with the values based on your requirements. ![]() The content in the following YAML template provides an example of the Deployment. The sidecar container can write the outputs of the application container to text files in the corresponding volume.Ĭreate a Deployment that contains a sidecar container. A volume can be mounted to multiple containers in a pod. To collect text files, you must use a shared volume in a pod. The sidecar container can access standard outputs that are collected by the basic components of the elastic container instance as files. When you create a pod, you can mount the stdlog volume to the sidecar container. To collect standard outputs, you must use the stdlog volume of the elastic container instance. ![]() You can use one of the following methods to collect logs: ![]() This way, Logtail can monitor the changes to log files in the shared directory and collect logs after the application container writes log data to the shared directory. Logtail and the application container must share the same directory that is used to store log files. To use a sidecar container to collect container logs, you must enable Logtail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |