> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apitally.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Configure the Apitally SDK for Java.

You can configure Apitally in your `application.yml` file.

```yaml application.yml {2-6} theme={null}
apitally:
  client-id: "your-client-id"
  env: "dev"
  request-logging:
    enabled: true
    # other parameters ...
```

## Parameters

The following configuration parameters are available. Only `client-id` and `env` are required.

| Parameter                      | Description                                                                                                       | Type     |
| :----------------------------- | :---------------------------------------------------------------------------------------------------------------- | :------- |
| <nobr>`client-id`</nobr>       | Client ID for your application. Find it on the *Setup instructions* page for your app.                            | `string` |
| `env`                          | Name of the environment, e.g. `prod` or `dev`. The environment will be automatically created if it doesn't exist. | `string` |
| <nobr>`request-logging`</nobr> | Configuration for request logging. See table below.                                                               | `object` |

The `request-logging` parameter is an object with the following properties:

| Parameter                                | Description                                                                                                                           | Type           | Default |
| :--------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ | :------------- | :------ |
| `enabled`                                | Whether request logging is enabled.                                                                                                   | `boolean`      | `false` |
| <nobr>`query-params-included`</nobr>     | Whether to include query parameters in the logs. If disabled, these will be stripped from the request URLs logged.                    | `boolean`      | `true`  |
| <nobr>`request-headers-included`</nobr>  | Whether to include request headers in the logs. Default masking for common sensitive headers (e.g. `Authorization`) applies.          | `boolean`      | `false` |
| <nobr>`request-body-included`</nobr>     | Whether to include the request body in the logs. Only JSON and text are supported, up to 50 KB.                                       | `boolean`      | `false` |
| <nobr>`response-headers-included`</nobr> | Whether to include response headers in the logs.                                                                                      | `boolean`      | `true`  |
| <nobr>`response-body-included`</nobr>    | Whether to include the response body in the logs. Only JSON and text are supported, up to 50 KB.                                      | `boolean`      | `false` |
| <nobr>`log-capture-enabled`</nobr>       | Whether to capture application logs emitted during request handling.                                                                  | `boolean`      | `false` |
| <nobr>`query-param-mask-patterns`</nobr> | List of regular expressions for matching query parameters to mask. These are in addition to the default masking patterns.             | `List<String>` | `[]`    |
| <nobr>`header-mask-patterns`</nobr>      | List of regular expressions for matching headers to mask. These are in addition to the default masking patterns.                      | `List<String>` | `[]`    |
| <nobr>`body-field-mask-patterns`</nobr>  | List of regular expressions for matching request/response body fields to mask. These are in addition to the default masking patterns. | `List<String>` | `[]`    |
| <nobr>`path-exclude-patterns`</nobr>     | List of regular expressions for matching paths to exclude from logging.                                                               | `List<String>` | `[]`    |
| <nobr>`callbacks-class`</nobr>           | Fully qualified name of a class implementing `RequestLoggingCallbacks` for custom masking and exclusion logic.                        | `string`       | -       |
