Configuration

Following examples assume the following class alias is defined:

use Tracy\Debugger;

Error Logging

$logger = Debugger::getLogger();

// if error has occurred the notification is sent to this email
$logger->email = 'dev@example.com';      // (string|string[]) defaults to unset

// email sender
$logger->fromEmail = 'me@example.com';   // (string) defaults to unset

// routine for sending email
$logger->mailer = ...;                   // (callable) default it sending by mail()

// after what shortest time to send another email?
$logger->emailSnooze = ...;              // (string) default is '2 days'

// for which error levels is BlueScreen also logged?
Debugger::$logSeverity = [E_WARNING, E_NOTICE];  // defaults to []

dump() behavior

// maximum string length
Debugger::$maxLength = 150;              // (int) default according to Tracy

// how deep will list
Debugger::$maxDepth = 10;                // (int) default according to Tracy

// hide values of these keys (since Tracy 2.8)
Debugger::$keysToHide = ['password', ...];  // (string[]) defaults to []

// visual theme (since Tracy 2.8)
Debugger::$dumpTheme = 'dark';           // (light|dark) defaults to 'light'

// displays the location where dump() was called?
Debugger::$showLocation = ...;           // (bool) default according to Tracy

Others

// in Development mode, you will see notice or error warnings as BlueScreen
Debugger::$strictMode = ...;             // (bool) defaults to true

// displays silent (@) error messages
Debugger::$scream = ...;                 // (bool) defaults to false

// link format to open in the editor
Debugger::$editor = ....;                // (string) defaults to 'editor://open/?file=%file&line=%line'

// path to template with custom page for error 500
Debugger::$errorTemplate = ...;          // (string) defaults to unset

// shows Tracy Bar?
Debugger::$showBar = ...;                // (bool) defaults to true

Debugger::$editorMapping = [
	// original => new
	'/var/www/html' => '/data/web',
	'/home/web' => '/srv/html',
];

Nette Framwork

If you are using the Nette Framework, you can also configure Tracy and add new panels to the Tracy Bar using the configuration file. The difference is that the settings are applied only after the DI container is created, so errors that occurred earlier cannot reflect them.

Improve this page