小编My *_* Lê的帖子

Laravel日志级别,有何不同?

我可以在Laravel 5.4中看到很少的日志选项,例如

Log::emergency($message);
Log::alert($message);
Log::critical($message);
Log::error($message);
Log::warning($message);
Log::notice($message);
Log::info($message);
Log::debug($message);
Run Code Online (Sandbox Code Playgroud)

我可以在更改日志级别app.php'log_level' => env('APP_LOG_LEVEL', 'debug'),任何种类的水平我想要的.

但我想知道,有什么不同?当critical, alert, emergency选择其中一个时,什么样的日志已被破坏?

php logging laravel laravel-5

6
推荐指数
1
解决办法
4534
查看次数

Laravel请求属性添加未出现

我创建了一个中间件,与原始请求相比,它会在请求中添加更多字段。

public function handle($request, Closure $next)
{
    $profile = Authentication::profile();
    $request->attributes->add(['dataUser' => $profile]);
    return $next($request);
}
Run Code Online (Sandbox Code Playgroud)

然后在我的控制器中,我使用此代码转储所有请求参数。

$request = Request::all();
Run Code Online (Sandbox Code Playgroud)

但是当我var_dump($request)dataUser字段不存在时,但奇怪的是当我调用Request::get('dataUser')时它仍然返回该值。

我知道我可以用于Request::get('dataUser')解决,但我只想使用$request = Request::all();而不是使用多个static类。

我犯了什么错误?

谢谢您的帮助。

php laravel

4
推荐指数
1
解决办法
4117
查看次数

标签 统计

laravel ×2

php ×2

laravel-5 ×1

logging ×1