I am using typo,and i found the log file is becoming bigger and bigger, is there a way to make it smaller?delete old log infomation? because when i want to check something through the log, it cost long time to download...... PS:i am using RedHat FC
You can always check it with the unix tail command. To check the last 200 lines, just do: tail -n 200 log/development.log Etc. You can also set your log rotation util (such as logrotate) to rotate the log daily or hourly or whatever. I''m not sure if there is a way to limit the verbosity of the logging in Rails, but I''d think you''d want all the info you can get and that rotation would be better than limiting what you let the server tell you :) On Jul 28, 2005, at 10:30 AM, hui wrote:> I am using typo,and i found the log file is becoming bigger and > bigger, > is there a way to make it smaller?delete old log infomation? > because when i want to check something through the log, > it cost long time to download...... > > PS:i am using RedHat FC > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
> I am using typo,and i found the log file is becoming bigger and bigger, > is there a way to make it smaller?delete old log infomation? > because when i want to check something through the log, > it cost long time to download......The RoR logger is basic, but I don''t think it''s really meant to be used in production environments. It has a common interface, so it should be very easy to swap it out with something else. logrotate is a bash script to uh.. rotate logs. You can probably use this on the stock RoR logger: http://iain.cx/src/logrotate/ log4r is a more comprehensive logging package, and I do believe it supports rolling over of logs. It should be a drop-in replacement for the RoR logger: http://log4r.sourceforge.net/ Then there''s the Rails Production Log Analyzer: http://rails-analyzer.rubyforge.org/. It comes with a syslog logger that you can drop in, and a nice script to a analyze your pages for performance issues. If I wasn''t on a shared host I''d probably use this. -- rick http://techno-weenie.net
hui wrote:>I am using typo,and i found the log file is becoming bigger and bigger, >is there a way to make it smaller?delete old log infomation? >because when i want to check something through the log, >it cost long time to download...... > >There''s almost certainly an easier way to do it, but one of the side-benefits of setting up SyslogLogger according to the docs from the Rails Production Analyzer is that''ll roll your logs over. I''ve just checked, and my production.log is 580Mb after 18 hours, so it''s been somewhat helpful for me. ...j
Another thing worth checking is whether you''re running in production or development mode? The logs are *much* more verbose in dev mode (all SQL appears, for example). Cheers, Colin On 7/28/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:> You can always check it with the unix tail command. > > To check the last 200 lines, just do: > > tail -n 200 log/development.log > > Etc. > > You can also set your log rotation util (such as logrotate) to rotate > the log daily or hourly or whatever. > > I''m not sure if there is a way to limit the verbosity of the logging > in Rails, but I''d think you''d want all the info you can get and that > rotation would be better than limiting what you let the server tell > you :) > > > > On Jul 28, 2005, at 10:30 AM, hui wrote: > > > I am using typo,and i found the log file is becoming bigger and > > bigger, > > is there a way to make it smaller?delete old log infomation? > > because when i want to check something through the log, > > it cost long time to download...... > > > > PS:i am using RedHat FC > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >