How to collect windows event logs(System event log, Application event log) from AKS pods?

Sreejith P S 1 Reputation point
2021-09-03T02:35:35.327+00:00

To debug a deployment pod, we would require windows system event log and application event logs from that particular pod.

Is it possible to collect the above mentioned logs rather than using 'kubectl log' command?

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,448 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,256 Reputation points MVP Volunteer Moderator
    2021-09-03T09:26:12.003+00:00

    Hi @Sreejith P S

    Thank you for posting in Q & A.

    The command kubectl get events -n <namespace> returns all events within a specific namespace

    Using kubectl describe pod <pod-name> provides a lot of useful information about the pod, including a section listing the latest events:

    kubectl log only collects the data from STDOUT & STDERR. As long as your application does not send logs to STDOUT & STDERR, you will be not able to see those with kubectl logs.
    As a temp workaround you can use kubectl exec to locate your logfiles and then kubectl cp to copy those to your local pc.
    Refer

    Container insights includes the Live Data feature, which is an advanced diagnostic feature allowing you direct access to your Azure Kubernetes Service (AKS) container logs (stdout/stderror), events, and pod metrics.
    How to view Kubernetes logs, events, and pod metrics in real-time

    Built-in to the Azure portal is the ability to view logs for the AKS master components or containers in an AKS cluster. Occasionally, you may need to get kubelet logs from an AKS node for troubleshooting purposes.
    Get kubelet logs from Azure Kubernetes Service (AKS) cluster nodes

    Using Azure Monitor Logs with Azure Kubernetes Service (AKS)

    If the Answer is helpful, please click Accept Answer and up-vote, so that it can help others in the community looking for help on similar topics.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.