Rails 2.1.0 Server log problem
Guys, I have to work with some legacy Rails 2.1.0
app for some reasons. They have designed it to use Ruby 1.8.6.
I installed RVM and installed ruby 1.8.7
. I installed all of the gems that the app requires (a real pain in Rails 2.x app compared to Bundler) and started the rails app using script/server command.
The problem arises with the server log I am getting. In development
rails mode, t开发者_C百科he log always comes in "info" mode and not in "debug" mode. In debug mode, our server log will show request params, controller & action, response time and everything. But all I get is this kind of log.
Referer -> /images/events-dir.png?1297230128
127.0.0.1 - - [16/Feb/2011:06:50:36 IST] "GET /images/org-url.png?1297230128 HTTP/1.1" 200 141824
Referer -> /images/org-url.png?1297230128
127.0.0.1 - - [16/Feb/2011:06:50:36 IST] "GET /images/iphone-frame.png HTTP/1.1" 200 47899
Referer -> /images/iphone-frame.png
127.0.0.1 - - [16/Feb/2011:06:50:36 IST] "GET /images/ipad-frame.png HTTP/1.1" 200 273013
Referer -> /images/ipad-frame.png
Damn, its really hard to work with this kind of log. I have explicitly mentioned
config.log_level = :debug
in environment.rb. But still after this, the output comes in "info" mode. Am i using the wrong ruby version. should I specifically use ruby 1.8.6 to get the desired/expected log output. Please help, I'm stuck in this for "days".
The important thing is when I tail -f
my development.log file, that file shows the correct format. essentially, when I start my server, it should start in "development" mode and it should tail -f
the development log. right ?
The log levels come in : :debug, :info, :warn, :error, and :fatal
Fatal being the least and debug being the most output. I think you want the least, so choose fatal of level 4.
Rails.logger.level = 4
Also you mentioned that the Ruby you're using is 1.8.6, but you installed 1.8.7. I would imagine you need to rvm install ruby-1.8.6
to get this working properly.
精彩评论