How to Log object?

后端 未结 5 2109
渐次进展
渐次进展 2021-02-01 13:21

I can see that Log facade is very useful. In the docs of laravel:

The logger provides the eight logging levels defined in RFC 5424: emergency, alert, cr

5条回答
  •  独厮守ぢ
    2021-02-01 13:48

    This will work, although logging the entire model will grow your log rather quickly.

    Log::info(print_r($user, true));
    

    The true in the second parameter of the print_r() method returns the information instead of printing it, which allows the Log facade to print it like a string.

提交回复
热议问题