> For the complete documentation index, see [llms.txt](https://docs.netmap.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netmap.dev/operations/logging.md).

# Logging

NetMap logs through the container runtime. In the all-in-one image, nginx and uvicorn run in the same container under `tini`, and Docker captures stdout/stderr.

## View Logs

```bash
docker compose logs --tail=200 netmap
```

nginx writes access logs to stdout and errors to stderr. uvicorn uses `LOG_LEVEL`, default `info`.

Documentation gap: this behaviour could not be verified from the current source for request IDs or structured logging.

## Configure Log Level

Set:

```dotenv
LOG_LEVEL=info
```

Accepted values are the uvicorn log levels used by the entrypoint:

* `debug`
* `info`
* `warning`
* `error`
* `critical`

Restart after changing `LOG_LEVEL`.

## Docker Log Rotation

The repository Compose examples use Docker's `json-file` logging driver with size rotation. A production Compose file should keep this or an equivalent log rotation policy:

```yaml
logging:
  driver: json-file
  options:
    max-size: 10m
    max-file: "5"
```

Without rotation, syslog-heavy or error-heavy deployments can consume disk space on the host.

## Useful Searches

```bash
docker compose logs netmap | grep -i "error"
docker compose logs netmap | grep -i "api key"
docker compose logs netmap | grep -i "syslog"
docker compose logs netmap | grep -i "firewall"
docker compose logs netmap | grep -i "backup"
docker compose logs netmap | grep -i "oidc"
```

## Sensitive Data

Do not paste logs publicly until you have reviewed them for:

* API keys;
* bearer tokens;
* usernames and email addresses;
* internal IP addresses and hostnames;
* OIDC issuer/client information;
* notification URLs or secrets.

## Related Pages

* [Diagnostic Information](/troubleshooting/diagnostic-information.md)
* [Syslog](/configuration/syslog.md)
* [API-Key Problems](/troubleshooting/api-key-problems.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.netmap.dev/operations/logging.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
