# アプリのコードのlogger作成のところ。フォーマッタでrequest_idを埋め込む log = Logger.new('log/app.log').tap do |logger| logger.formatter = proc{|severity, datetime, progname, message| "time:#{datetime.strftime("%FT%T%z")}\tlevel:#{severity}\trequest_id:#{RequestStore[:request_id] || '-'}\tprog:#{progname}\tmessage:#{message}\n" } end log.warn "Hi!!!" => "time:2016-03-24T12:30:02+0900 level:WARN request_id:e68d8328e4ea46137