To retrieve all logs, run the following command:
microk8s kubectl logs --tail=-1 -l tier=elma365 --all-containers > logs.txt
To view the logs of a specific service, run the following command (replacing [name] with the name of the service you need):
microk8s kubectl logs --tail=-1 -l app=[name]
Example:
microk8s kubectl logs --tail=-1 -l app=main
To view log files in real time, run the command above with the -f option.
Example:
microk8s kubectl logs --tail=-1 -l app=main -f
The --tail option allows you to display only the last lines of a large log file.
Was this helpful?
Found a typo? Highlight the text, press ctrl + enter and notify us