I’ve got a logger set up in my application using BufferedLogger. I’m able to write logs from my rspec tests and from my rake tasks, but for some reason when I log from my application nothing happens. It was working a week or so ago, but lately the file just won’t update. I put a debugger on my main page and tried this:
(rdb:3) logger
#<ActiveSupport::BufferedLogger:0xa142b34 @level=0, @buffer={},
@auto_flushing=1, @guard=#<Mutex:0xa142a1c>,
@log=#<File:/mnt/hgfs/proj/log/development.log>>
(rdb:3) logger.debug "Hellooo??"
"Hellooo??\n"
(rdb:3) logger.error "Hellooo??"
"Hellooo??\n"
(rdb:3) logger.flush
[]
When I opened the file it was empty. I guessed that it was a file permissions issue but it looks fine:
-rwxrwxrwx 1 root root 0 2012-02-15 15:47 development.log*
I thought that it might be because I was using the itslog gem, so I removed that from my gemfile but that didn’t do anything.
What should I check next?
No answers yet, so here’s what fixed it: restarting the VM. Not sure what was going on that was stopping logging but apparently restarting the VM fixed it.