Files
authentik/website/docs/troubleshooting/logs.md
chwshka 5fda531e2b website/docs: add section on how to capture logs (#13662)
* Added logs file with basic instructions for capturing logs

* Included kubernetes instructions

* Fixed typos

* Fixed commands

* typo

* Updated kubernetes section

* updated as per suggestions from Dominic

* further changes to simplify the document

* Added section about Ctrl + C to stop logs

---------

Co-authored-by: Dewi Roberts <dewi@goauthentik.io>
2025-03-25 12:28:57 -05:00

1.7 KiB

title
title
Capturing logs

When troubleshooting issues it is useful to investigate the event logs that are continuosuly outputted by authentik.

Capturing Past Logs

The --since option can be used with both docker logs and kubectl logs commands. It can accept a Go durating string (e.g. 1m30s, 3h) or a specific date/time (e.g. 2006-01-02T07:00, 2006-01-02). When used, the command will output logs for the specified time period.

More information on this option and others can be found in the docker logs command documentation and kubectl logs command documentation.

Docker

To capture and display the logs of a Docker container in the terminal, use the following command:

docker logs <container_name_or_id> --timestamps --since 5m

Kubernetes

To capture and display the logs from a pod deployed via Kubernetes, use the following command:

kubectl logs --timestamps --since 5m <pod_name>

Continuously Capturing Logs

To continuously display logs from a Docker container or a pod deployed via Kubernetes, you can include the follow option (-f, --follow). This option will stream logs into the terminal until stopped (Ctrl + C or closing the terminal).

Docker

To stream the logs from a Docker container, use the following command:

docker logs <container_name_or_id> -f --timestamps

Kubernetes Logs

To stream the logs from a pod deployed via Kubernetes, use the following command:

kubectl logs -f --timestamps <pod_name>