29.07.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Errors & Logging<br />

• Introduction<br />

• Configuration<br />

• The Exception Handler A> - Report Method A> - Render Method<br />

• HTTP Exceptions A> - Custom HTTP Error Pages<br />

• Logging<br />

Introduction<br />

When you start a new Laravel project, error and exception handling is already configured for you.<br />

In addition, Laravel is integrated with the Monolog¹⁴⁷ logging library, which provides support for a<br />

variety of powerful log handlers.<br />

Configuration<br />

Error Detail<br />

The amount of error detail your application displays through the browser is controlled by the<br />

debug configuration option in your config/app.php configuration file. By default, this configuration<br />

option is set to respect the APP_DEBUG environment variable, which is stored in your .env file.<br />

For local development, you should set the APP_DEBUG environment variable to true. In your<br />

production environment, this value should always be false.<br />

Log Modes<br />

Out of the box, Laravel supports single, daily, syslog and errorlog logging modes. For example,<br />

if you wish to use daily log files instead of a single file, you should simply set the log value in your<br />

config/app.php configuration file:<br />

.<br />

1 'log' => 'daily'<br />

¹⁴⁷https://github.com/Seldaek/monolog

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!