views:

36

answers:

2

Hi Guys,

I have cleared my Rails app's log file with rake log:clear.

Then Rails stopped logging the errors.... the Logfile is still empty, even though errors appeared again.

Any help?

Greets, Joern.

A: 

Try restarting the Rails server process.

John Topley
no that was not the solution :(
Joern Akkermann
+1  A: 

It might be possible that you changed the permissions on the log file by mistake, and the user you're running your webapp server with is not the same as the one that owns the logfile.

In any case, if you run 'script/console', it should warn you if it can't write to the log file. If it doesn't, then a logfile has gotta be being written somewhere.

This is the warning the console will print if it can't write to the logfile for some reason:

Rails Error: Unable to access log file. Please ensure that /Users/mtoledo/Projects/stackoverflow/log/development.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed. Loading development environment (Rails 3.0.0.beta4)

Also, keep in mind it will be writing to 'development.log' unless you're changing your environment, but since you said it was writing to it before I assume that's not the issue

Marcos Toledo
the write rights on the log filer where really missing... even though I changed them, rails doesn't log... that's so annoying... I am already thinking about that something hacked me.
Joern Akkermann
Nothing hacked you probably. If the write permissions were off on your original file, then that's probably because something tinkered with them, changing the default in the first place. Like I said, run the console, see if it logs or prints any error messages. Also try doing it on a plain new webapp to see if its not some webapp issue.
Marcos Toledo