I hope to store the log file by day , because the log file will be so large with the time goes by.Is it possible to do this ? -- 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 To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/PYoMWvlmjO4J. For more options, visit https://groups.google.com/groups/opt_out.
On 20 October 2012 14:28, leo108 <cyh108005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I hope to store the log file by day , because the log file will be so large > with the time goes by.Is it possible to do this ?You could provide a daily cron task, something like cd /path/to/application && RAILS_ENV=production rake log:clear or without the rails_env if it is the development log that you are interested in. 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 https://groups.google.com/groups/opt_out.
On Sat, Oct 20, 2012 at 8:28 AM, leo108 <cyh108005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I hope to store the log file by day , because the log file will be so > large with the time goes by.Is it possible to do this ? > > >I am curious which log library you are using. From the standard library it is clear you can do this easily, if you are concerned about size or date: http://ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html#method-c-new -- 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 https://groups.google.com/groups/opt_out.
On 21 October 2012 12:09, Victor Goff <keeperotphones-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sat, Oct 20, 2012 at 8:28 AM, leo108 <cyh108005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> I hope to store the log file by day , because the log file will be so >> large with the time goes by.Is it possible to do this ? >> >> > > I am curious which log library you are using. > > From the standard library it is clear you can do this easily, if you are > concerned about size or date: > > http://ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html#method-c-newI guess he is using the standard rails logger. How would one apply this to the standard logger, I can''t see in my code where it is created. 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 https://groups.google.com/groups/opt_out.
On Sun, Oct 21, 2012 at 7:32 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 21 October 2012 12:09, Victor Goff <keeperotphones-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On Sat, Oct 20, 2012 at 8:28 AM, leo108 <cyh108005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > >> I hope to store the log file by day , because the log file will be so > >> large with the time goes by.Is it possible to do this ? > >> > >> > > > > I am curious which log library you are using. > > > > From the standard library it is clear you can do this easily, if you are > > concerned about size or date: > > > > > http://ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html#method-c-new > > I guess he is using the standard rails logger. How would one apply > this to the standard logger, I can''t see in my code where it is > created. > > ColinCan you use logrotate or whatever the OS gives for rotating logs? -- 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 https://groups.google.com/groups/opt_out.
On Sun, Oct 21, 2012 at 5:29 PM, Victor Goff <keeperotphones-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you use logrotate or whatever the OS gives for rotating logs?Yes I agree you should be using logrotate because most logging in applications is not rotated by them, but instead by logrotate, this way you can easily adjust the time between your logging, for example I rotate all my logs hourly some people do it daily, some monthly. If this were to happen in every application it would become a pretty annoying task imo. -- 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 https://groups.google.com/groups/opt_out.