setExceptionHandler(function ($e) { if (stripos($e->getMessage(),"Permission denied")){ try { if (PHP_OS != 'WINNT')exec("chmod 777 ".base_path("storage/logs/error-".date("Y-m-d").".log"),$output,$return); }catch (\Exception $e){ Log::critical("日志写入错误",["msg"=>$e->getMessage(),"user"=>Auth::id()]); } } }); } }