# Debug
Debug enables to dump information about errors that may be affecting the software functionality. If Chevereto isn't working properly it will require debugging to understand the situation.
Once you enable debug you need to trigger the issue again, this will generate a log that will help you to understand what is going on.
# Debug Errors
To debug errors go to Settings > System > Debug errors (opens new window) and enable "Debug errors". By enabling this Chevereto will debug errors to the screen (only to administrators).
# Debug with xrDebug
- Run xrDebug built-in server:
cd app && vendor/bin/xr
- Enable xrDebug from your Chevereto settings (opens new window).
# Debug with Docker
Replace CONTAINER
with the container name.
Chevereto error log:
docker logs CONTAINER -f 1>/dev/null
Chevereto access log:
docker logs CONTAINER -f 2>/dev/null
# Debug (development)
Debug can be configured using environment variables.
Note: This variable is read from $_ENV
(server context) not from app/env.php
(Chevereto app).
CHEVERETO_ENVIRONMENT=dev
# Editing source
You can force error display by editing the source code.
- Open
app/legacy/load/register-handlers.php
- Change this:
$isDebug = isDebug();
- To this:
//$isDebug = isDebug();
$isDebug = true;
# Debug level
Note on debug levels
Error level >= 2 is not recommended for production environments. Is not safe to print the errors to the screen, handle it with care.
Level (N) | Description |
---|---|
0 | No debug |
1 | (default) Debug to log_device |
2 | Print errors (no logging) |
3 | Print errors and log to log_device |
Use CHEVERETO_DEBUG_LEVEL=N
to configure the debug level.
# Error log device
Use CHEVERETO_ERROR_LOG
to customize where error log will be written.
Permissions
Double-check that the target log device is writable by the user running PHP.
# Finding the logs
This vary depending the server provider and how PHP runs in the server. In doubt, always ask first to your system administrator.
- Chevereto
- Logs by default at
php://stderr
- Logs by default at
- Docker
- Logs to
/dev/stderr
- Logs to
- xrDebug
- Streams the debug messages to the xrDebug session
- Apache
- Logs by default at
/var/log/apache2/error.log
- Virtual host directive defines custom error log location
- Commonly configured for
/var/www/domain.com/logs
- Logs by default at
- NGINX
- Logs by default at
/var/log/nginx/error.log
- Server block defines custom error log location
- Commonly configured for
/var/www/domain.com/logs
- Logs by default at
- cPanel
- Logs by default at
../domain.com.error.log
(parent ofpublic_html
folder) - Vary a lot from providers and cPanel version
- Logs by default at
# I can't find the logs
You can configure CHEVERETO_DEBUG_LEVEL
>= 2 but note that this error reporting level could compromise your installation. Restrict any public access to your website and revert to CHEVERETO_DEBUG_LEVEL=1
as soon as possible.
If you can't find the logs or you are having a hard time with this you can request Extra Support (opens new window) so we can safely debug your installation.