我写在了yml 的注释中。。。 一句话: 无法使用INFO, 只能要么DEBUG, 要么WARNlog4r_config:
loggers:
- name : production
# 注意,这里修改的没用
# 只能在 程序中 Rails.logger.level = 1 (情况A)
# 或者 config/environments/production.rb 中 config.log_level = :warn (情况B)
#
# 但是有问题。
# 情况B有时候不好使。 情况A一直都可以。
# 但是情况A的问题是, debug:0, info: 1 , warn: 2, error: 3 fatal: 4, unknow: 5
# 如果设置 level = 1的话,显示的是debug级的日志。
# 所以,我们只能折中,在代码中 Rails.logger.level = 2
# logger.level = 2
level : WARN
trace : 'true'
outputters :
- datefile
Ruby Loggerlevel,log_level的问题
This post is licensed under
CC BY 4.0
by the author.