logger.debug 未写入 Rails 中的日志文件 [英] logger.debug not writing to log file in Rails

查看:42
本文介绍了logger.debug 未写入 Rails 中的日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Rails 中调试模型,所以我正在使用以下代码:logger.debug('asasd')

I am trying to debug a model in Rails so I'm using this code: logger.debug('asasd')

但是,我拖尾了日志文件 development.log 但我没有看到它添加到这个文件中.

However, I'm tailing the log file development.log but I'm not seeing it add to this file.

  1. 我确定这个模块正在运行
  2. 我已确认运行时错误正在记录到此文件中,并且我在尾随时看到了这些错误.

我如何让它发挥作用?

推荐答案

确保您已在环境/适当的_env_file.rb 中将日志级别设置为调试:

Make sure that you have set the log level to debug in environments/appropriate_env_file.rb:

config.log_level = :debug

还要确保根据运行环境跟踪正确的日志文件.

and also make sure you are tailing the correct log file based on the environment you are running against.

这篇关于logger.debug 未写入 Rails 中的日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆