こんにちは! フリーエンジニアの長瀬です。 今回はlogger(ロガー)の使い方について一緒に学んでいきましょう。 loggerを使えば、Railsで簡単にログを出力できます。 この記事では、loggerの使い方について ・loggerの設定方法 という基本的な内容から、 ・ログの色付けを行う方法 といった応用的な内容についても解説していきます。 loggerとは loggerはログを出力するために、Railsにあらかじめ用意されている機能です。 また、loggerの機能はActiveSupportクラスを継承したLoggerクラスによって構成されています。 loggerを使えば、簡単にログを出力できます。 なので、バグの原因を探すときなどに便利です。 loggerの設定方法 loggerは ・config/application.rb ・config/evironments/develo