How to get AKS logs generated by hosted webapplication

Kalyan Gandham 130 Reputation points
2024-05-28T06:48:59.4233333+00:00

Hi Team,

Is there any way to get location of AKS logs files of web application deployed in AKS.

Actually, Grafana Loki is getting logs, but wanted to know from which location grafana loki is getting logs.

Thanks

Kalyan

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. akinbade abiola 20,465 Reputation points
    2024-05-28T07:54:03.9566667+00:00

    Hello Kalyan Gandham,

    Thanks for your question.

    Grafana Loki logs are usually gotten from the container logs. With Grafana loki, the typical workflow involves applications writing logs to standard output (stdout) or standard error (stderr), and then a log collection agent like Fluentd or Logstash sidecar container captures and ships them to a centralized location (Loki in this instance)

    See an example architecture: https://learn.microsoft.com/en-us/azure/architecture/microservices/logging-monitoring

    Please let me know if you have further questions**

    You can mark it 'Accept Answer' if this helped.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. vipullag-MSFT 26,411 Reputation points
    2024-05-28T07:50:51.4866667+00:00

    Hello Kalyan Gandham

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Container logs in AKS (and Kubernetes in general) are written to the node's filesystem under var/log/containers
    If you are using Grafana Loki to collect logs from your AKS cluster, it is likely that it is using the Kubernetes API to access the logs. The logs are stored in the var/log/containers directory on each node in the cluster.

    SSH into your AKS nodes and check the var/log/containers directory to verify if the logs are stored there.

    Use kubectl to describe your pods and check events/logs to see how logging is configured:

    kubectl describe pod <your-pod-name> -n <your-namespace>

    Hope this helps.

    1 person found this answer helpful.
    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.