Hi, I was debugging the problem of nothing being written in my production logs (it works fine in development mode), although the application was working fine. On investigating I found out that Rails.logger.auto_flushing was being set to 1000 in production mode. I upgraded from rails 3.0.3 to 3.0.7 thinking that it might be an issue with that version, but the problem still persists. I have fixed the problem temporarily by adding Rails.logger.auto_flushing =1 in my environment file, but am not able to establish as to why is this happening. Why is auto_flushing being set to 1000 in production mode? Regards, Amit -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rails.logger.auto_flushing = 1 in production environment file is also throwing an exception. It seems that the logger is not being initialized, as Rails.logger is being returned as nil, but on console it returns an ActiveSupport::BufferedLogger object. irb(main):001:0> Rails.logger => #<ActiveSupport::BufferedLogger:0xb6729640 @guard=#<Mutex: 0xb6715fa0>, @buffer={}, @auto_flushing=1000, @level=1, @log=#<File:/u/ apps/billbaba/releases/20110423222330/log/production.log>> Any thoughts......anything I might have messed up....??? Regards, Amit On Apr 24, 3:51 am, amit_saxena <amit4u...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I was debugging the problem of nothing being written in my production > logs (it works fine in development mode), although the application was > working fine. On investigating I found out that > Rails.logger.auto_flushing was being set to 1000 in production mode. > > I upgraded from rails 3.0.3 to 3.0.7 thinking that it might be an > issue with that version, but the problem still persists. I have fixed > the problem temporarily by adding Rails.logger.auto_flushing =1 in my > environment file, but am not able to establish as to why is this > happening. Why is auto_flushing being set to 1000 in production mode? > > Regards, > Amit-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 24 April 2011 13:04, amit_saxena <amit4uall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Rails.logger.auto_flushing = 1 in production environment file is also > throwing an exception. > > It seems that the logger is not being initialized, as Rails.logger is > being returned as nil, but on console it returns an > ActiveSupport::BufferedLogger object.What happens if you make a new app and run in production mode? If that is ok then you could go back to earlier versions of your app from your version control system and see at what point the log stopped working. Alternatively, I believe the only differences between development and production are in environments/development.rb and production.rb (plus database.yml). Compare the two rb files and if nothing is obvious change production.rb so that it becomes more like development.rb until the logger starts working. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Colin for the help :) Figured it out, while trying random things. Probably was a permissions issue and was resolved on changing the permissions from 644 to 666; but interestingly no error was being thrown out that passenger was unable to write to log file in the apache error logs. Interestingly when I still try to inspect the logger on console the auto_flushing is set to 1000 for production mode (1 for development mode): Loading production environment (Rails 3.0.7) irb(main):001:0> Rails.logger => #<ActiveSupport::BufferedLogger:0xb667805c @guard=#<Mutex: 0xb66649a8>, @buffer={}, @auto_flushing=1000, @level=1, @log=#<File:/u/ apps/billbaba/releases/20110425202117/log/production.log>> But the good news is that the logs are working! Regards, Amit On Apr 24, 5:18 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 24 April 2011 13:04, amit_saxena <amit4u...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Rails.logger.auto_flushing = 1 in production environment file is also > > throwing an exception. > > > It seems that the logger is not being initialized, as Rails.logger is > > being returned as nil, but on console it returns an > > ActiveSupport::BufferedLogger object. > > What happens if you make a new app and run in production mode? > > If that is ok then you could go back to earlier versions of your app > from your version control system and see at what point the log stopped > working. > > Alternatively, I believe the only differences between development and > production are in environments/development.rb and production.rb (plus > database.yml). Compare the two rb files and if nothing is obvious > change production.rb so that it becomes more like development.rb until > the logger starts working. > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.