【发布时间】:2017-01-27 05:26:00
【问题描述】:
我正在使用此代码在我的 Sinatra 应用程序中启用日志记录:
log_file = File.new('my_log_file.log', "a")
$stdout.reopen(log_file)
$stderr.reopen(log_file)
$stdout.sync=true
$stderr.sync=true
实际的日志记录是使用:
logger.debug("Starting call. Params = #{params.inspect}")
事实证明,只有 INFO 或更高级别的日志消息会被记录,而 DEBUG 消息不会被记录。我正在寻找一种将日志级别设置为调试的方法。
【问题讨论】: