﻿# Audit, error audit and log files

> WorkSmartHub records what users do, which errors happen, and what the server writes to its log files. The pages are under Események & Naplófájlok (Events & log files).

Source: https://workwise-solutions.net/docs/features/audit-and-logs/ · Language: en · Hungarian version: https://workwise-solutions.net/hu/docs/features/audit-and-logs/

WorkSmartHub records what users do, which errors happen, and what the server writes to its log files. The pages are under **Események & Naplófájlok** (Events & log files).

| Page | Permission | What it shows |
|---|---|---|
| **Események** (Events) | *Audit reader* | Every recorded user action |
| **Hiba Események** (Error events) | *Error audit reader* | Errors returned by the API |
| **Naplófájlok** (Log files) | *Log files reader* | The server's daily log files |
| **Ügyfél Email Események** (Client e-mail events) | Super admin | Automatic e-mails sent to clients |

## Events (Események)

![Events page](https://workwise-solutions.net/docs/images/audit-events.png)
*Esemény bejegyzések: type, acting user and time.*

Every change made in the application is recorded: ticket create and update, attachment upload, client edit, user and permission changes, token creation, configuration changes (with the changed fields and old and new values; secrets are never recorded), and so on. Filter by **Típusok** (types) and **Eljáró felhasználó** (acting user). Click an entry to see its details on the right.

**Export** writes the entries to a CSV file. You can filter by types, user and date range, and set the delimiter, quoting and escape character.

## Error events (Hiba Események)

![Error events](https://workwise-solutions.net/docs/images/audit-errors.png)
*An error entry with its request ID and message.*

Each error entry has a type, the user, the time, the request ID and the message. Users with the *Log files reader* permission also get **Részletes keresés** (Detailed search by request ID) and **További részletek** (More details), which pull the matching lines from the log files; **Hiba vágólapra másolása** copies them. Export works as on the events page.

## Log files (Naplófájlok)

![Log files](https://workwise-solutions.net/docs/images/audit-logfiles.png)

The server writes one log file per day (the `Logs/log-.txt` setting of `appsettings.json`). The page lists the files with their full path and modification time, and can filter by date. Select files and use **Letöltés** (Download) to download them compressed; the icon at the end of a row opens the content in a new tab.

![Log file content](https://workwise-solutions.net/docs/images/audit-logfiles-viewer.png)
*The content of a log file opened in a new tab.*

Request logs never contain the values of credential query parameters (tokens, OAuth codes, passwords and similar are written as `***`). The minimum log levels come from `appsettings.json`, or from **App Konfiguráció → Log Szintek** if the override there is turned on ([App configuration](https://workwise-solutions.net/docs/features/app-configuration/#log-szintek-log-levels)). Keep file logging enabled: this page reads those files.

## Client e-mail events (Ügyfél Email Események)

![Client e-mail events](https://workwise-solutions.net/docs/images/audit-client-emails.png)

Lists the e-mails sent to clients: *Munkajegy létrehozásának visszaigazolása* (ticket registration confirmation), *Szállítási / Kiszállási információk* (delivery information) *Munkajegy késedelem* (delay) and *Számla* (invoice PDF, with *WorkSmartHub értesítés* delivery). Each row shows the ticket, the e-mail type, the work and ticket types, the guarantor, the client and the time. Open the ticket in a new tab from the row, or delete the entry.

## Retention

The background job **Adatbázis tisztítás** (Database housekeeping) deletes events, error events and action tokens older than their retention period (365 days each by default). A retention of 0 keeps everything. See [App configuration](https://workwise-solutions.net/docs/features/app-configuration/#háttérfolyamatok-background-jobs).
