> For the complete documentation index, see [llms.txt](https://docs.k9.io/key9-identity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.k9.io/key9-identity/maxmind-api-proxy/configuration/run-modes.md).

# Run Modes

The `http_mode` field controls the verbosity of request logging and the behaviour of the underlying Gin HTTP framework.

```json
{
  "http_mode": "release"
}
```

***

## Available modes

| Mode         | Gin framework mode | Request logging                                    | Query statistics            | Use case                            |
| ------------ | ------------------ | -------------------------------------------------- | --------------------------- | ----------------------------------- |
| `debug`      | `debug`            | Full Gin debug output including route registration | Printed after every request | Development and troubleshooting     |
| `test`       | `test`             | Gin test mode output                               | Printed after every request | Automated integration tests         |
| `release`    | `release`          | Standard Gin access log                            | Printed after every request | Production with logging             |
| `production` | `release`          | **Suppressed entirely**                            | **Suppressed entirely**     | Production without logging overhead |

***

## Mode details

### `debug`

Gin prints all registered routes at startup, plus a coloured access log line for every request. The proxy also logs per-request statistics showing the running total, cache hit/miss counts, and hit rate percentage. Use this when first setting up the proxy or diagnosing problems.

```
[GIN-debug] GET  /:ip_address  --> main.Maxmind_Query_IP (3 handlers)
[GIN] 2025/06/12 - 10:00:01 | 200 | 1.234ms | 10.0.0.1 | GET /8.8.8.8
[ Total Queries: 5 | Cached: 3 [60.0%] | Not Cached: 2 [40.0%] - 8.8.8.8 pull from cache.
```

### `release`

The standard production mode. Gin does not print route registration or coloured debug output, but still logs each request. Query statistics are still printed to stdout after every lookup. Suitable for environments where a log aggregator (e.g. Loki, Splunk, CloudWatch) collects stdout.

### `test`

Intended for use with automated test suites. Behaves like `release` for logging purposes.

### `production`

All logging is suppressed — Gin's access log, query statistics, and error messages are all discarded. Use this when the proxy is running in a high-throughput environment and log volume is a concern, or when logs are genuinely not needed.

> The proxy still starts and functions normally; errors are silently dropped rather than logged.

***

## Choosing a mode

| Scenario                                      | Recommended mode |
| --------------------------------------------- | ---------------- |
| Local development                             | `debug`          |
| CI / automated tests                          | `test`           |
| Production with a log aggregator              | `release`        |
| High-throughput production, no logging needed | `production`     |


---

# 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:

```
GET https://docs.k9.io/key9-identity/maxmind-api-proxy/configuration/run-modes.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.
