log4r

Undefined Method Formatter for Log4r in RAILS 4.0

不打扰是莪最后的温柔 提交于 2019-12-05 13:17:33
I am getting this error after upgrading Rails from 3.1.2 to 4.0. When launching my server with rails s I got stuck with the following error C:/ruby-2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:78:in `start': undefined method `formatter' for #<Log4r::Logger:0x26dd908> (NoMethodError) I have been on the Log4r site but haven't got any infor;ation about a bug when upgrading Rails. Does anyone have any idea where this bug comes from. Thank you! The method formatter is not defined on Log4r::Logger , but on Log4r::FileOutputter . Therefore I am surprised that is worked

Ruby: Uninitialized constant Log4r::DEBUG (NameError) problem

给你一囗甜甜゛ 提交于 2019-12-04 12:11:16
While using log4r in Ruby, I wrote a configuration file similar to the following: require 'rubygems' require 'log4r' require 'log4r/outputter/datefileoutputter' SERVICE_LOG = { :log_name => 'service', :log_file => 'service.log', :log_level => Log4r::DEBUG, :message_pattern => "[%-5l %d] %C: %M", :date_pattern => "%Y-%m-%d %H:%M:%S" } when I ran it, it threw out the following exception: C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Log4r::DEBUG (NameError) Why did it do that? This is a little weird

Properly using Log4r in Ruby Application

a 夏天 提交于 2019-12-04 11:40:09
问题 I must really be missing something obvious, but I'm having trouble with general use of Log4r in my Ruby application. I am able to log without issue, but the overhead seems clunky the way I have it setup. I'm basically passing the full path to a filename to log in each class in my application. The ruby script that is called pulls the log file from one of the arguments in ARGV which is then passed around and set in each class that I call in ruby. In each class I use the patternFormatter to

Properly using Log4r in Ruby Application

北城以北 提交于 2019-12-03 07:20:17
I must really be missing something obvious, but I'm having trouble with general use of Log4r in my Ruby application. I am able to log without issue, but the overhead seems clunky the way I have it setup. I'm basically passing the full path to a filename to log in each class in my application. The ruby script that is called pulls the log file from one of the arguments in ARGV which is then passed around and set in each class that I call in ruby. In each class I use the patternFormatter to insert the class/file name into the log statement. Is there a better way to make this work? It feels like

Is Ruby's stdlib Logger class thread-safe?

泄露秘密 提交于 2019-12-01 02:06:07
In short, is the standard library Logger class in Ruby thread-safe? Only useful info Google turned up was someone on a forum saying it "seems" thread-safe. And I don't feel like spending time testing a logger to try to figure out if it is or not. For the time being I'm using log4r which is thread-safe, but it's overkill if the standard library already does it. A quick look at logger.rb reveals code such as the following: def write(message) @mutex.synchronize do if @shift_age and @dev.respond_to?(:stat) begin check_shift_log rescue raise Logger::ShiftingError.new("Shifting failed. #{$!}") end

How to configure Log4r with Rails 3.0.x?

无人久伴 提交于 2019-11-27 08:05:05
I tried configuring log4r with Rails 3.0.4 based on this article: http://www.dansketcher.com/2007/06/16/integrating-log4r-and-ruby-on-rails/ /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:166:in `sub!': can't convert Pathname into String (TypeError) from /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:166:in `block in paramsub' from /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:165:in `each' from /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:165:in

How to configure Log4r with Rails 3.0.x?

喜你入骨 提交于 2019-11-26 14:04:04
问题 I tried configuring log4r with Rails 3.0.4 based on this article: http://www.dansketcher.com/2007/06/16/integrating-log4r-and-ruby-on-rails/ /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:166:in `sub!': can't convert Pathname into String (TypeError) from /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:166:in `block in paramsub' from /Users/toto/.rvm/gems/ruby-1.9.2-p0/gems/log4r-1.1.9/lib/log4r/yamlconfigurator.rb:165:in