| id | debug |
|---|---|
| title | Debugging Application |
| description | This document describes how to debug the application. |
- Make sure you have installed composer dependencies first of all
To see which templates are used during page rendering, enable debug output in the settings/settings.ini.php file:
'debug_output' => true,
By default, an exception that ends with the "fatal error" page is only sent to the PHP error log and stored in lh_audits. To also write it to cache/default.log, enable log_errors in the settings/settings.ini.php file:
'site' => array (
// ...
'debug_output' => false,
'log_errors' => true,
),The default value is false.
What it does:
- Applies to uncaught exceptions handled by the web entry point (
index.php), by the module runner (erLhcoreClassModule::runModule()) and by the last-resort handler (erLhcoreClassModule::defaultExceptionHandler()). - Writes the full exception dump (
print_r($e, true)— message, file, line and stack trace) withWARNINGseverity througherLhcoreClassLog::write()intocache/default.log. - The file is rotated automatically at about 200 KB, keeping up to 5 backups (
cache/default.log.1…cache/default.log.5). The owner of a newly created file can be set with thedefault_useranddefault_groupsettings. - It is independent from the database audit log:
lh_auditsrecords (including those created byerLhcoreClassModule::logException()) are written regardless of this option. cron.phpalways logs failures tocache/default.log— this option only controls the web request handlers.- It does not show anything to the visitor. Use
debug_outputto see the exception in the browser.
Notes:
debug_outputtakes precedence: when it is enabled, the exception is printed and the request exits, so nothing is written tocache/default.log. Disable it to collect log entries.- PHP fatal errors that are not exceptions (memory exhaustion,
max_execution_time, parse errors) are not handled by these handlers and will not appear in this log. - Make sure
cache/is writable by the web server and thatcache/default.logis not reachable over HTTP — log entries may contain request data and stack traces.System configurationcontains a security check for this.
To see all used templates, you must also disable the cache.
'templatecache' => true,
'templatecompile' => true,
'modulecompile' => true,
This should be used only as a last option if anything else does not work.
and change to
@ini_set('error_reporting', 1);
@ini_set('display_errors', E_ALL);The web application has the following folder structure:
cache(Stores cached files)design(Contains design categories)<used_design>
doc(Release documentation)extension(All extensions are placed here)ezcomponentslib(Core of the framework)autoloadslhcore_autoload.php(Main application autoload file)
core(Folder containing application logic modules)models(Folder containing application model classes)modules(Application modules are placed here)pos(Represents eZ Components POS, persistent object tables definitions)settings(Contains application settings files)translations(Contains application translations)
Go to System configuration > Audit (Configuration) and enable Log javascript errors. After that, any JavaScript errors will be logged to System configuration > Audit (Audit Logs).
You can search for JavaScript errors using these search attributes:
- Category -
js - Source -
lhc
Most of the time, the compiled JS file has a map file. For example, if an error occurred in:
https://demo.livehelperchat.com/design/defaulttheme/js/widgetv2/index.js
There will also be a source map file:
https://demo.livehelperchat.com/design/defaulttheme/js/widgetv2/index.js.map
Afterwards, you can use https://jimbly.github.io/stackwalker/index.html to find the exact error.
After enabling debug output, you will see a popup window similar to this:
Regarding widget debugging, you will not see debug output so easily. These instructions also apply to embedded widgets and site widgets.
As shown in the example above, widget styles can be overridden by editing the customtheme/css/widget_override.css file. The debug output shows all files searched during page load. If you want to edit the invitation to chat green block, the easiest way to do that is to override the styles using the !important flag. These styles should be in your site CSS file, not the widget_override.css file.
After doing that, a new window will open in Chrome. Just delete "view-source:" and you will see the full list.
- Disable cache
- Enable debug output
- Enable
log_errorsand checkcache/default.logfor an error message. - Check the Chrome console for an error (
CTRL+SHIFT+J). - Read My widget does not load
- See the Audit Logs section for an error.
- Debugging incoming webhooks



