English 中文(简体)
Rails 2.1.0服务器日志问题
原标题:Rails 2.1.0 Server log problem

伙计们,由于一些原因,我不得不使用一些遗留的<code>Rails 2.1.0</code>应用程序。他们将其设计为使用Ruby 1.8.6。

我安装了RVM并安装了<code>ruby 1.8.7</code>。我安装了该应用程序所需的所有gem(与Bundler相比,Rails2.x应用程序中的一个真正的痛苦),并使用脚本/服务器命令启动了Rails应用程序。

我得到的服务器日志出现了问题。在developmentrails模式下,日志总是以“info”模式出现,而不是以“debug”模式出现。在调试模式下,我们的服务器日志将显示请求参数、控制器和;行动、响应时间等等。但我得到的只是这种原木。

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

该死,用这种原木真的很难。我已经明确提到

config.log_level=:调试

在environment.rb中。但在此之后,输出仍处于“info”模式。我用错ruby版本了吗。我应该特别使用ruby 1.8.6来获得所需/预期的日志输出吗。请帮帮我,我已经被困了好几天了。

重要的是,当我<code>tail-f</code>我的development.log文件时,该文件显示了正确的格式。本质上,当我启动服务器时,它应该以“开发”模式启动,并且应该跟踪开发日志-f。正确的

问题回答

日志级别包括::debug、:info、:warn、:error和:fatal

致命是最少的,调试是最多的输出。我认为你想要的最少,所以选择致命的4级。

Rails.logger.level = 4

您还提到您使用的Ruby是1.8.6,但您安装了1.8.7。我想你需要rvm安装ruby-1.86才能正常工作。





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签