mirror of
https://github.com/goauthentik/authentik
synced 2026-04-27 18:07:15 +02:00
* Start doc * WIP * WIP * Move files into directory * Add redirect for forward auth * Fix forward auth doc * Update logging-events.mdx Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Fix manually deployed outpost env variable * Update website/docs/troubleshooting/logs/outpost_logs.mdx Co-authored-by: Dominic R <dominic@sdko.org> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Apply suggestions * Update website/docs/troubleshooting/logs/logs.mdx Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/troubleshooting/logs/logs.mdx Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/troubleshooting/logs/outpost_logs.mdx Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/troubleshooting/logs/outpost_logs.mdx Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Apply suggestions * Update logs.mdx Signed-off-by: Dominic R <dominic@sdko.org> * Update outpost_logs.mdx Signed-off-by: Dominic R <dominic@sdko.org> * Update outpost_logs.mdx Signed-off-by: Dominic R <dominic@sdko.org> --------- Signed-off-by: Dewi Roberts <dewi@goauthentik.io> Signed-off-by: Dominic R <dominic@sdko.org> Co-authored-by: Dominic R <dominic@sdko.org>
161 lines
3.9 KiB
Plaintext
161 lines
3.9 KiB
Plaintext
---
|
|
title: Capturing authentik logs
|
|
---
|
|
|
|
import TabItem from "@theme/TabItem";
|
|
import Tabs from "@theme/Tabs";
|
|
|
|
When troubleshooting issues in authentik, reviewing the logs can be invaluable. These logs provide continuous output, helping to diagnose problems effectively.
|
|
|
|
For information on capturing standalone outpost logs, refer to [capturing standalone outpost logs](./outpost_logs.mdx).
|
|
|
|
## Adjusting log levels
|
|
|
|
The server and worker containers support multiple log levels: `debug`, `info`, `warning`, and `error`. By default, the log level is set to `info`.
|
|
|
|
To modify the log level, follow the steps for your platform
|
|
|
|
<Tabs
|
|
groupId="platform"
|
|
defaultValue="docker"
|
|
values={[
|
|
{label: 'Docker Compose', value: 'docker'},
|
|
{label: 'Kubernetes', value: 'kubernetes'},
|
|
]}>
|
|
<TabItem value="docker">
|
|
|
|
1. Add the following environment variable to your docker deployment:
|
|
|
|
```shell
|
|
AUTHENTIK_LOG_LEVEL=debug
|
|
```
|
|
|
|
2. Recreate your containers to apply the changes.
|
|
|
|
</TabItem>
|
|
<TabItem value="kubernetes">
|
|
|
|
1. Add the following configuration to your `values.yml` file:
|
|
|
|
```yaml
|
|
authentik:
|
|
log_level: debug
|
|
```
|
|
|
|
2. Recreate your containers to apply the changes.
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
## Enabling `trace` mode
|
|
|
|
:::danger
|
|
The trace log level provides deeper insights, but be aware that using trace logs can expose sensitive information, including session cookies. Handle these logs with extreme caution and avoid using trace unless absolutely necessary.
|
|
:::
|
|
|
|
To enable `trace` logging, follow the platform-specific steps below:
|
|
|
|
<Tabs
|
|
groupId="platform"
|
|
defaultValue="docker"
|
|
values={[
|
|
{label: 'Docker Compose', value: 'docker'},
|
|
{label: 'Kubernetes', value: 'kubernetes'},
|
|
]}>
|
|
<TabItem value="docker">
|
|
|
|
1. Add the following environment variable to your docker deployment:
|
|
|
|
```shell
|
|
AUTHENTIK_LOG_LEVEL=trace
|
|
```
|
|
|
|
2. Recreate your containers to apply the changes.
|
|
|
|
:::danger
|
|
To avoid exposing sensitive information, remember to reduce the log level from `trace` once you finish troubleshooting.
|
|
:::
|
|
|
|
</TabItem>
|
|
<TabItem value="kubernetes">
|
|
|
|
1. Modify your `values.yml` file:
|
|
|
|
```yaml
|
|
authentik:
|
|
log_level: trace
|
|
```
|
|
|
|
2. Recreate your containers to apply the changes.
|
|
|
|
:::danger
|
|
To avoid exposing sensitive information, remember to reduce the log level from `trace` once you finish troubleshooting.
|
|
:::
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
## Viewing past logs
|
|
|
|
To review historical logs, you can use the `--since` option with both `docker logs` and `kubectl logs`. This option allows you to specify either a duration (e.g., `1m30s`, `3h`) or a specific timestamp (e.g., `2006-01-02T07:00`, `2006-01-02`) to view logs generated after that point in time.
|
|
|
|
For more details, see the [`docker logs` documentation](https://docs.docker.com/reference/cli/docker/container/logs/) and [`kubectl logs` documentation](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/).
|
|
|
|
<Tabs
|
|
groupId="platform"
|
|
defaultValue="docker"
|
|
values={[
|
|
{label: 'Docker', value: 'docker'},
|
|
{label: 'Kubernetes', value: 'kubernetes'},
|
|
]}>
|
|
<TabItem value="docker">
|
|
|
|
To retrieve logs from a specific timeframe, use:
|
|
|
|
```shell
|
|
docker logs <container_name_or_id> --since 5m
|
|
```
|
|
|
|
</TabItem>
|
|
<TabItem value="kubernetes">
|
|
|
|
To fetch logs from a Kubernetes pod:
|
|
|
|
```shell
|
|
kubectl logs --since 5m <pod_name>
|
|
```
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
## Streaming logs in real-time
|
|
|
|
To continuously monitor logs, use the `--follow` (`-f`) option. This will stream log output to your terminal until manually stopped (`Ctrl + C` or closing the terminal).
|
|
|
|
<Tabs
|
|
groupId="platform"
|
|
defaultValue="docker"
|
|
values={[
|
|
{label: 'Docker', value: 'docker'},
|
|
{label: 'Kubernetes', value: 'kubernetes'},
|
|
]}>
|
|
<TabItem value="docker">
|
|
|
|
To follow logs in real time:
|
|
|
|
```shell
|
|
docker logs <container_name_or_id> -f
|
|
```
|
|
|
|
</TabItem>
|
|
<TabItem value="kubernetes">
|
|
|
|
To stream logs from a Kubernetes pod:
|
|
|
|
```shell
|
|
kubectl logs -f <pod_name>
|
|
```
|
|
|
|
</TabItem>
|
|
</Tabs>
|