> Source: https://docs.cyberelements.io/bastion/4.6/Usage/AdminConsoleReference/AutomaticLogs/

# Automatic logs

The **Automatic logs** module lets an administrator produce a Bastion activity log in CSV format — either on demand or on a recurring schedule (monthly, weekly or daily) with delivery by e-mail to a list of recipients.

The screen has two sections: on-demand generation, then scheduling.

---

## Generate log

This section produces a log immediately for the date range entered.

| Field | Description |
|---|---|
| **Begin date** | Date in `dd/mm/yyyy` format. Pre-filled with today's date. |
| **Ending date** | Date in `dd/mm/yyyy` format. Pre-filled with today's date. |
| **Generate log** | Button that starts server-side generation for the dates entered. While generating, the state is polled every 5 seconds. |
| *(state)* | Label displayed to the right of the generate button. Three values: **No log available**, **Log generation in progress**, **Logs available for download**. |
| **Download log** | Enabled once generation completes. Downloads the log (`report.csv`). |
| **Download statistics** | Enabled once generation completes. Downloads the matching summary (`summary.csv`). |

> **Asynchronous behaviour**
>
> While generation is running, both download buttons **and** the **Generate log** button are disabled: a new generation cannot be started before the previous one finishes.

---

## Automatic logs

Collapsible section with a checkbox in its title. When the box is checked, scheduling is enabled. It is disabled by default.

Only one schedule exists at a time: saving replaces the previous one, and clearing the checkbox deletes it.

### Recurrence

Three mutually exclusive options, each with the field that parameterises it:

| Field | Description |
|---|---|
| **Monthly** | Generates the log every month, on the date given by the **Next generation** field alongside. |
| **Weekly** | Generates the log every week, starting from the date given by the **Next generation** field alongside. |
| **Daily** | Generates the log every day. The first run happens the same day at the time entered, or the next day if that time has already passed. |
| **Next generation** | Date of the first run, in `dd/mm/yyyy` format. It cannot be earlier than the current day. Each of the two dated options carries its own field. |
| **Generation hour** | Time in `hh:mm` format (00:00 to 23:59), checked by a regular expression. Displayed alongside **Daily**, it applies to **all three** recurrences. |

### Delivery by e-mail

| Field | Description |
|---|---|
| **SMTP server** | Non-editable drop-down list of the SMTP servers declared in the configuration. Mandatory when scheduling is enabled. |
| **Issuer** | Sender e-mail address, checked as a valid address. |
| **Destination email address** | Input field (placeholder **Mail**) followed by the **Add** button: the address joins the list if it is valid and not already present. |
| *(recipient grid)* | **Mail** column listing the addresses added. Each row carries a delete button, with a confirmation quoting the address. |

> **Validation on save**
>
> Saving with **Validate** is only possible when scheduling is disabled **or** the recipient list holds at least one address. When the list is empty, the grid is highlighted to flag the error. The window closes once the save is confirmed.

---

> **Time zone**
>
> The browser time offset is sent to the server both when the screen loads and when it is saved: the scheduled date and time are therefore interpreted in the time zone of the administrator who entered them.
