Debug Mode

Self-hosted ActiveCollab by defualt runs in production model, but application also supports debug mode. This mode is useful when you are troubleshooting the system.

Once in debug mode, following resources become available:

  1. Execution details are logged in /logs directory. Use them to find notices, warnings, and errors, or to see if system executes correctly,
  2. When ActiveCollab returns an error (like 500) due to an exception, response will include exception details that you can use for further debugging.

Enable Debug Mode #

To enable debug mode, open config/config.php file, and look for a line that declares APPLICATION_MODE. If that declaration exists, make sure that its value is set to debug.

If APPLICATION_MODE declaration does not exist, add these three lines, at the beginning of the configuration file (after <?php openning tag):

1
2
3
ini_set('display_errors', 1);
error_reporting(E_ALL);
const APPLICATION_MODE = 'debug';
Note

Make sure that APPLICATION_MODE is declared only once. Having it appear twice may break the system because constants can be declared only once.

Disabiling Debug Mode #

System should not run in debug mode. It is designed for troubleshooting, and should be disabled as soon as troubleshooting is over. Debug mode can cause several issues when used in production:

  1. Slow things down because a lot more info is captured and logged during execution,
  2. Use a lot of disk space with log files (several gigabytes each day for busy servers),
  3. Expose paths and other internal execution data in error responses to the browser. That info is important for debugging, but should never be exposed in production.

In order to disable debug mode, open config/config.php file, find and remove lines that:

  1. Declare APPLICATION_MODE option,
  2. Override display errors settings using ini_set('display_errors', 1); call,
  3. Override error reporting settings, using error_reporting() function call.