Simple route throw exception

This is only log, how to throw exception error into laravel framework using routes.php

#sudo vim routes.php

add this in that file

Route::get('you_have_been_compromised', function() {
throw new \Exception("This is the error goes.");

i did this because i need to simulate the error, and make sure error is not write to instances files anymore but it’s stream out directly to log server. The result will be vary but one thing that you need to know that you will save a lot hard disk space in your instance and you don’t have to manage logrotate and you can combine the sumologic or any alert agent only in your log server don’t have to put the error agent in each of your instances.

Credits to my friend ‘sky akbar ko’

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s