LoginSignup
0
0

More than 1 year has passed since last update.

PHP・Rubyのスタックトレースの出し方

Posted at

スタックトレース

スタックトレースとは、実行中のコンピュータプログラムにエラーが発生した際に、直前に実行していた関数やメソッドなどの履歴を表示すること。
ログよりも詳しいエラー箇所を特定することができる。

Ruby

ドキュメントには載ってないが、join("\n")しないとかなり見づらいのでした方がいい。

def methd
  raise
end

begin
  methd
rescue => e
  logger.error e.backtrace.join("\n")
end

PHP

debug_print_backtrace();

0
0
2

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
0
0