> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.clientexec.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to enable logging - Generating Log Files for Support

When troubleshooting issues, our support staff may ask you to provide a log file. These logs help us identify errors, failed requests, or other important system activity.
Follow the steps below to enable logging and generate a log file:

### ⚙️ How to Enable Logging in Clientexec

1. Open your `config.php` file, located in the root directory of your Clientexec installation.
2. Edit the following two lines:

```
define('LOG_LEVEL', 4);
define('LOG_TEXTFILE', 'ce.log');
```

  🔒 **Important:**
* Use quotes around the file path for `LOG_TEXTFILE`.
* Make sure the specified file exists and is **writable** by the web server.
* **Do not place** the log file in your web root directory (e.g., `public_html`) — it may contain sensitive data like passwords.

### 🔢 Logging Levels (0–6)

Use a number between **0 and 6** for `LOG_LEVEL`. (Though generally our support staff will ask you to set it to level 4). Each level logs additional details:
* **0** – No logging
* **1** – Security attack attempts, errors and important messages (recommended level)
* **2** – Reserved for debugging (only logs if `DEBUG` is true in config.php)
* **3** – Warnings and EventLogs, VIEW/ACTION and Request URIs and URI redirections and POST/COOKIE values
* **4** – Plugin events, curl requests, some function calls with their parameters, etc.
* **5** – Include suppressed actions and SMTP traffic
* **6** – Action responses (ajax, serialized, XML as array)

### 🧪 Reproducing the Problem

To generate a useful log file:
1. Set the appropriate `LOG_LEVEL` (usually 4, or 5 for SMTP issues)
2. Reproduce the problem
3. Disable logging afterward by resetting the `config.php` lines to:

```
define('LOG_LEVEL', 1);
define('LOG_TEXTFILE', false);
```

### 📤 Submitting Logs to Support

* Use **log level 4** for most issues
* Use **log level 5** for SMTP/email problems
* Attach the generated log file to your support ticket and then you can delete the log file.
