0
我使用Log4r的Log4j XML格式化程序与电锯交谈,如here in Log4r's manual所述。然而,基本上我得到的只是信息和警告级别 - 我没有看到那里显示的额外细节。Log4r和Chainsaw:收集其他日志消息的详细信息(行号等)?
这里的语境中,我使用它,这在我看来很相似,他们(注意我还使用了例如电锯配置文件修改的):
@log = Log4r::Logger.new "#{self.class.name}"
log4jformat = Log4r::Log4jXmlFormatter.new
hostname = opts[:chainsaw_hostname] || DEFAULT_CHAINSAW_HOST
port = opts[:chainsaw_port] || DEFAULT_CHAINSAW_PORT
udpout = Log4r::UDPOutputter.new 'udp', :hostname => hostname, :port => port
udpout.formatter = log4jformat
@log.outputters = [udpout]
@log.debug 'this is a message with level debug'
对此有何建议?我再次看到这些消息出现,他们只是没有附加额外的细节,例如发生日志事件的类/方法/行。
介意试用最新的开发者快照?许多新功能,更稳定...可在这里:http://people.apache.org/~sdeboy – Scott
@斯科特,谢谢 - 现在挖掘它。看起来很不错! –