LoginSignup
2
0

More than 1 year has passed since last update.

Log::Debugってobject出力できないのかい

Last updated at Posted at 2022-09-01

Log::Debugはobjectを出力できない

中身がobjectの変数を

Log::debug($hoge)

という感じにそのまま出力しようとしたら

Object of class 〇〇 could not be converted to string

ってエラー出た
laravel.logでログ見たいのに…

解決法

Log::debug(print_r($hoge,true))

のように、print_r()を挟む事によって解決

trueを忘れると、変数の中身ではなく、中身の有無(boolean)で表示されてしまうので注意

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0