Problem setting log level

Hello

I’m new to both ruby and rails and have problem getting any debug
information from the log. When i encounter an “We’re sorry, but
something went wrong” message, i look in the “log/development.log” and
this is all i find:

Started GET “/characters/7” for 127.0.0.1 at 2012-09-23 11:45:34 +0200
Processing by CharactersController#show as HTML
Parameters: {“id”=>“7”}
Character Load (0.2ms) SELECT “characters”.* FROM “characters” WHERE
“characters”.“id” = ? LIMIT 1 [[“id”, “7”]]
Rendered characters/show.html.erb within layouts/application (22.1ms)
Completed 500 Internal Server Error in 25ms

i’ve also tried setting:

config.log_level = :debug

in config/enviroments/development.rb but the log looks the same.

I’m i missing something here?

Thanks
Daniel

Btw I am using Rails 3.2.3.

I have checked that Rails.logger.level = 0 so it should be :debug. And
i’m also sure that i’m running in development mode. But still I just get
this one line telling me about an internal error wich doesnt help me a
bit.

Update:

Seems like the right log level is set. But for som reason i dont see an
error message and a stacktrace when encountering an error. Is there more
configuration to be done or should this be enough to be able to see the
stacktrace?

If you’re seeing the “friendly” Sorry message, then you may be in
production mode. I only ever see the sorry a problem occurred in
production, the rest of the time it’s stack traces all around.

Walter

walterdavis: “We’re sorry, but something went wrong” is the error
message i get. When i start the development server i see “Rails 3.2.8
application starting in development on http://0.0.0.0:3000”.
log/development.log is the logfile that is used. Seems to me that i’m in
development mode.

I have now tried to upgrade to rails 3.2.8, recreate the project but
same thing :frowning:

On Sep 24, 2012, at 2:20 PM, Daniel S. wrote:

walterdavis: “We’re sorry, but something went wrong” is the error
message i get. When i start the development server i see “Rails 3.2.8
application starting in development on http://0.0.0.0:3000”.
log/development.log is the logfile that is used. Seems to me that i’m in
development mode.

I have now tried to upgrade to rails 3.2.8, recreate the project but
same thing :frowning:

Check your /config/environments/development.rb file. There’s a setting
there called consider_all_requests_local which should be set to true. If
it isn’t, you might see the non-stack-trace “friendly” error message.
Otherwise, I have no idea what’s happening to your site.

Walter

Yes it is set to true. It seems like this is the default behavior on my
rails installation. I did a test: i created a new rails project,
generated a scaffold model, inserted a faulty link_to helper like: <%=
link_to ‘bogus’, some_bogus_non_existing_path %> in one of the views. I
start the development server and visit the site and the error message
and lack of stacktrace is all the same.

Thanks anyway Walter

Hi Daniel,

i’m facing the same problem and i’m using ubuntu 12.04, rvm,
ruby 1.9.2-p320.
Do you have a similar setup and os?

Christian

That feels like a regression. Can you file a bug/issue on the
appropriate library? Here’s what I see when I repeat this with Rails
3.0.latest (running in production, but with consider_all_requests_local
set to true):

Walter

Christian: Hey, that was actually the problem! :slight_smile:

I was having a blank in the path of my project directory, and removing
that fixed the problem. Great, this was beginning to get somewhat
frustrating…

I’m am running Debian Wheezy with rvm and Ruby 1.9.3-p286 so the setup
is pretty similar.

Thank you were much for sharing Christian!

It seems (at least on ubuntu), that umlauts or blanks in the path of the
rails app, will cause rails to show the “We’re sorry,…” screen without
any backtrace. By removing the umlauts and blanks the right backtrace is
showing up.

Hope this helps.

Christian