Score:0

How to access container custom logs,azure kubernetes?

ke flag

Our container creates log files in /var/appname/app1/java log and other multiple log files. While development,we used to connect the container directly and access the log file using bind mounts. Can anyone suggest how to deal with in azure kubernetes aks? The logs section in monitoring shows only default logs.

I can access the logs using kubectl command or with volumes. But we need this to be visible in azure kubernetes portal logs section so that we can see the daily statistics.

Can you please suggest how to do that.?

azure logs

Score:0
it flag

The official documentation has several recommendations regarding Debug Running Pods:

  • Examining pod logs: by executing kubectl logs ${POD_NAME} ${CONTAINER_NAME} or kubectl logs --previous ${POD_NAME} ${CONTAINER_NAME} if your container has previously crashed

  • Debugging with container exec: run commands inside a specific container with kubectl exec: kubectl exec ${POD_NAME} -c ${CONTAINER_NAME} -- ${CMD} ${ARG1} ${ARG2} ... ${ARGN}

  • Debugging with an ephemeral debug container: Ephemeral containers are useful for interactive troubleshooting when kubectl exec is insufficient because a container has crashed or a container image doesn't include debugging utilities. You can find an example here.

  • Debugging via a shell on the node: If none of these approaches work, you can find the host machine that the pod is running on and SSH into that host.

AKS also helps with that by offering the Container Insights:

Container insights gives you performance visibility by collecting memory and processor metrics from controllers, nodes, and containers that are available in Kubernetes through the Metrics API. Container logs are also collected.

More sources can be found below:

uday avatar
ke flag
Many thanks for the links, but my question is how to get custom logs of my application in container insights or monitoring section of aks.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.