# Using the configuration file.

### Set authentication endpoint in configuration file

To enhance security and flexibility, you can directly set the notification endpoints in the **`configuration.json`**-file.

Example configuration for notification endpoints:

```json
"event_callbacks": [
  {
    "type": "onRelease",
    "url": "https://my-url.com/tmining",
    "secret": "wbLF2qz8bbsWY6"
  }
]
```

You can configure multiple callbacks by listing them in an array, allowing you to set different endpoints for different types of notifications.

***

### Set API Network Settings in configuration file.

The **`configuration.json`** file also contains network settings:

* On line 2, you can enable or disable SSL by setting the protocol to either **`https`** (for SSL) or **`http`** (without SSL):

  ```json
  "protocol": "https",
  ```
* If SSL is enabled, specify the certificates to use:<br>

  ```json
  "httpServer": {
    "port": 4431,
    "ssl": {
      "serverCert": "certificates/server-cert.pem",
      "serverKey": "certificates/server-key.pem"
    }
  }
  ```
* On line 32, you can update the port number used for incoming requests:<br>

  ```json
  "httpServer": {
    "port": 5000
  }
  ```

{% hint style="danger" %}
Restart the API service after modifying these settings.
{% endhint %}

***

### Set logging parameters in configuration file.

You can fine-tune logging by modifying the **`log4js`** section in the **`configuration.json`-**&#x66;ile. The most important setting is the **`level`** parameter:

#### Default logging, level setting - `debug`

```json
"level": "debug"
```

#### Increased logging, level setting - `trace`&#x20;

```json
"level": "trace"
```

{% hint style="danger" %}
Please note: the "trace" will generate a lot of logging.\*
{% endhint %}

***

### Configure log, file settings.

**EXAMPLE** for compressing the logs automatically and using rotating logfiles with a limited size:

```json
"file": {
"type": "dateFile",
"filename": "api.log",
"numBackups": "7",
"compress": true,
"layout": {
"type": "pattern",
"pattern": “%[%d %p [%f{2}:%l]%] %m%n"
}
}
```

Above configuration retains 7 compresse log backups.

{% hint style="success" %}
You can use all the **`log4js`**-settings, which are documented on the

[**OFFICIAL DOCUMENTATION SITE**](https://log4js-node.github.io/log4js-node/file.html).
{% endhint %}


---

# 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://developer.securecontainerrelease.com/getting-started/authentication/using-the-configuration-file..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.
