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

# How to enable Error Logging?

> Enable WordPress error logging by adding WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY constants to wp-config.php on your MainWP Dashboard site. Errors will be logged to /wp-content/debug.log.

Error logging helps diagnose connection issues and plugin conflicts by recording PHP errors and warnings to a log file. Enable this on your MainWP Dashboard when troubleshooting problems.

## What You'll Learn

* Enable WordPress debug mode
* Configure error logging to a file
* Access and read the debug log

## Prerequisites

* FTP or file manager access to your Dashboard site
* Ability to edit wp-config.php

***

## Enable Error Logging

**1. Access wp-config.php**

Connect to your MainWP Dashboard site via FTP or your hosting file manager and open `wp-config.php`.

**2. Add debug constants**

Insert the following code **before** the line `/* That's all, stop editing! Happy blogging. */`:

```php theme={null}
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
```

**3. Save the file**

Save your changes to wp-config.php.

***

## What Each Setting Does

| Constant | Purpose |
| - | - |
| `WP_DEBUG` | Enables debug mode, which enables error tracking |
| `WP_DEBUG_LOG` | Writes errors to `/wp-content/debug.log` |
| `WP_DEBUG_DISPLAY` | When false, hides errors from visitors while still logging them |

***

## Access the Debug Log

Find your error log at:

```text theme={null}
/wp-content/debug.log
```

You can access this file via:

* FTP or SFTP
* Hosting file manager
* SSH command: `tail -f /path/to/wp-content/debug.log`

***

## Disable Error Logging

When you've finished troubleshooting, disable debug mode to improve performance and security:

```php theme={null}
define( 'WP_DEBUG', false );
```

Or remove the debug constants entirely.

> [!WARNING]
>
> Do not leave debug mode enabled on production sites. The debug log may contain sensitive information and debug mode can affect performance.

***

## Self-Check Checklist

* [ ] Debug constants are added to wp-config.php
* [ ] Constants are placed before the "stop editing" line
* [ ] debug.log file is being created in /wp-content/
* [ ] Errors are being logged when issues occur

***

## Related Resources

* [Troubleshoot Connection Problems](https://docs.mainwp.com/troubleshooting/potential-issues.md) - Common connection issues
* [WordPress Debugging](https://wordpress.org/support/article/debugging-in-wordpress/) - Official WordPress debugging guide
* [Editing wp-config.php](https://wordpress.org/support/article/editing-wp-config-php/) - wp-config.php reference


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.