Debugging December 12, 2022
Enabling debug modes
Since Zenphoto 1.6 it is possible to set the debug modes you need directly in your zp-data/zenphoto.cfg.php file.
Add $conf['debugmode'] = true; anywhere in your zenphoto.cfg.php file (exept where it says "Do not edit above/below this line")
You can disable any debug mode and still keep the setting in the zenphoto.cfg.php file (for later use) by setting the mode to false.
Any of the following debug modes may be used:
- $conf['test_release'] = true; – Enables test release mode, supports the markRelease plugin. All PHP errors are written into the Debug log. This enableds three debug modes: debug_error, debug_image_err and debug_404.
- $conf['debug_login'] = true; – Log admin saves and login attempts.
- $conf['debug_error'] = true; – Log the calling sequence with zp_error messages.
- $conf['debug_image'] = true; – Log image processing information.
- $conf['debug_image_err'] = true; – Flag image processing errors.
- $conf['debug_404'] = true; – Log 404 error processing debug information
- $conf['debug_exif'] = true; – Log start/finish of exif processing.
- $conf['debug_plugins'] = true; – Log plugin load sequence.
- $conf['debug_filters'] = true; – Log filter application sequence.
- $conf['explain_selects'] = true; – Log the "EXPLAIN" of SELECT queries.
- $conf['debug_locale'] = true; – Used for examining language selection problems.
Zenphoto has two logs enabled by default. The Debug log and Setup log. By activating the security-logger plugin you can also enable the Security log.
All log files are located in the zp-data folder, in the root of your installation. The log files are created automatically when an error or action triggers them. So when there are no PHP errors or setup is not run, these log files are not yet present. When log files are present they can be viewed on the backend under the Logs tab, which is only visible when you are logged-in with full admin rights.
- Debug log: logs all PHP errors, warnings and notices, following PHP's E_ALL reporting level.
- Setup log: logs all system checks, the loading of themes, plugins and extensions.
Security log: logs the following:
- IP address of the client browser (the IP may be anonymize as defined on the related option)
- type of entry/action
- user ID/user name
- success/failure of an action (installation, login, etc.)
- authority granting/denying the request
- Additional information, for instance on failure, the password used
There are options to set a max file size for the Debug and Security logs in Options -> General (debug log limit and security log limit). Additional log files will be created sequentialy when their specified size is exceeded.
There is no need to have an option for a max file size for the Setup log since this file is refreshed each time setup is run, so it doesn't grow in size. Most likely you will only be interested in the log of the last setup anyway.
This text by www.zenphoto.org is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Code examples are released under the GPL v2 or later license
For questions and comments please use the forum or discuss on the social networks.