# Logs

The system produces two sets of logs:

## Application (django) logs

Django emits operational logs to stdout and can be viewed with Docker or via dokku.

To view a snapshot of recent logs with dokku, run:

```
dokku logs APP
```

To view a continuous stream of logs, run:

```
dokku logs APP -t
```

You can view logs for a particular process (`web` or `tasks`), run:

<pre><code># background tasks
dokku logs APP -p tasks -t
<strong>
</strong><strong># web requests
</strong>dokku logs APP -p web -t
</code></pre>

### Viewing logs using docker

The website processes are normal docker containers. You can view the docker logs using standard docker commands, for example:

Find the ID of the docker container you want to check the logs for:

```
docker ps
```

View the logs for that container

```
docker logs -f --since 10m abc123
```

## Nginx access logs

Nginx writes access logs for all requests to `/var/log/nginx/APP-access.log`. View them with a command such as:

```
tail -f /var/log/nginx/APP-access.log
```

These logs are rotated according to your installed nginx log rotation configuration.

## Nginx error logs

Nginx writes error logs to `/var/log/nginx/APP-error.log`. View them with a command such as:

```
tail -f /var/log/nginx/APP-error.log
```

These logs are rotated according to your installed nginx log rotation configuration.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liieditors.docs.laws.africa/system-management/logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
