Reputation: 321
We can access pod related logs from Log Analytics Workspace but there are no app logs (similar to what we see in kubectl get events
).
I was referring the Azure documentation but I am still unable to access Application Pod logs from Azure Portal
Upvotes: 3
Views: 20205
Reputation: 131
In the portal part you have to go to the Kubernetes Services --> Monitoring --> Logs.
In this part, you have to query what you want. Similar to kubectl but in kusto query language.
Then you can try this query:
let startTimestamp = ago(1h);
KubePodInventory
| where TimeGenerated > startTimestamp
| project ContainerID, PodName=Name
| distinct ContainerID, PodName
| join
(
ContainerLog
| where TimeGenerated > startTimestamp
)
on ContainerID
// at this point before the next pipe, columns from both tables are available to be "projected". Due to both
// tables having a "Name" column, we assign an alias as PodName to one column which we actually want
| project TimeGenerated, PodName, LogEntry, LogEntrySource
| order by TimeGenerated desc
I found this and tried it and it works. More information on this page if you want to take a look.
Upvotes: 9