本文整理汇总了PHP中Illuminate\Support\Facades\Log::emergency方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::emergency方法的具体用法?PHP Log::emergency怎么用?PHP Log::emergency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Log
的用法示例。
在下文中一共展示了Log::emergency方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($e instanceof QueryException) {
Log::emergency($e->getMessage());
return response()->json(["Houve um erro interno no servidor."], 500);
}
return parent::render($request, $e);
}
示例2: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
try {
$task = Task::findOrFail($id);
$task->delete();
return response()->json(['destroy' => true]);
} catch (Exception $e) {
Log::emergency('TaskAPIController::destroy can not destroy task', ['task_id' => $id]);
return response()->json(['destroy' => true], 500);
}
}
示例3: emergency
/**
* System is unusable.
*
* @param string $message
* @param array $context
*
* @return bool
*/
public function emergency($message, array $context = [])
{
return Log::emergency($message, $context);
}
示例4: emergency
/**
* @param $data
* @param array $contextualData
* @param array $location
*/
public static function emergency($data, array $location = [], array $contextualData = [])
{
$msg = self::renderMessage($data, $location);
/** @noinspection PhpUndefinedMethodInspection */
BaseLog::emergency($msg, $contextualData);
}