I've looked through the documentation and can't find a way to change the logging for any errors, which normally write to /app/storage/logs/logs/log-apache2handler-xxxx-xx-xx.txt
but on the production server, I want any of those to be emailed to me instead.
Is there a way to do this?
use package like
Begin by installing this package through Composer. Edit your project's composer.json file to require dinesh/bugonemail.
Or visit
http://dineshrabara.github.io/bugonemail/
I still log the error, and if it's production, send an email with the exception:
App::error(function(Exception $exception, $code)
{
Log::error($exception);
if (Config::getEnvironment() == 'production')
{
$data = array('exception' => $exception);
Mail::send('emails.error', $data, function($message)
{
$message->from($email_app);
$message->to(Config::get('settings.error_email'))->subject(Config::get('settings.app_name') . ' Error');
});
Log::info('Error Email sent to ' . Config::get('settings.error_email'));
return Response::view('errors.500', array(), 500);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With