我想限制日志大小并放置此行
config.logger = Logger.new(config.paths.log.first, 1, 5.megabytes)
没有运气,我得到了未定义的方法错误
config.paths.log
NoMethodError: undefined method `log' for #<Rails::Paths::Root:0x007fa5c1de7308>
config.paths
[3] pry(#<COT::Application>)> config.paths
#<Rails::Paths::Root:0x007fa5c1de7308 @current=nil,
...
"log"=>#<Rails::Paths::Path:0x007fa5c1de5c38 @paths=["log/development.log"], @current="log", @root=#<Rails::Paths::Root:0x007fa5c1de7308 ...>
答案 0 :(得分:2)
尝试
config.paths['log'].first
而不是
config.paths.log.first