<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Rotating Rails Log Files</title>
	<atom:link href="http://www.nullislove.com/2007/09/10/rotating-rails-log-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/</link>
	<description>Code for Coders</description>
	<pubDate>Thu, 11 Mar 2010 02:51:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael Hale</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-1418</link>
		<dc:creator>Michael Hale</dc:creator>
		<pubDate>Wed, 22 Apr 2009 14:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-1418</guid>
		<description>The problem with using copytruncate instead of create is that there is the possibility of loosing log data if your process writes to the original file after the copy, but before the truncate. Using create instead of copy truncate solves this problem, but you have to be able to signal your process (restart works) so that it starts writing to the new log file. Here is logrotate file I'm using for production mongrels: http://gist.github.com/99826</description>
		<content:encoded><![CDATA[<p>The problem with using copytruncate instead of create is that there is the possibility of loosing log data if your process writes to the original file after the copy, but before the truncate. Using create instead of copy truncate solves this problem, but you have to be able to signal your process (restart works) so that it starts writing to the new log file. Here is logrotate file I&#8217;m using for production mongrels: <a href="http://gist.github.com/99826" rel="nofollow">http://gist.github.com/99826</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Logfiles getting big? Rotate them automatically! &#171; My Pragmatig life</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-1370</link>
		<dc:creator>Logfiles getting big? Rotate them automatically! &#171; My Pragmatig life</dc:creator>
		<pubDate>Tue, 03 Mar 2009 11:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-1370</guid>
		<description>[...] if there are more than 3 of them they get deleted. Maximum filesystem usage: 30mb An alternative is using logrotate which is a harder to setup and maintain, but offers more [...]</description>
		<content:encoded><![CDATA[<p>[...] if there are more than 3 of them they get deleted. Maximum filesystem usage: 30mb An alternative is using logrotate which is a harder to setup and maintain, but offers more [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Bearden</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-1362</link>
		<dc:creator>Chad Bearden</dc:creator>
		<pubDate>Tue, 17 Feb 2009 23:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-1362</guid>
		<description>Thanks for the article.  If you are doing this on a ubuntu or debian based system make sure that logrotate is actually installed.  It's easy to be fooled since apache and mysql install rotate scripts in /etc/logrotate.d 

To install:

sudo apt-get install logrotate

add your new config file to: /etc/logrotate.d

test:

sudo logrotate -d /etc/logrotate.c/my_servers_rotate_script

force a rotate:

sudo logrotate -f /etc/logrotate.c/my_servers_rotate_script</description>
		<content:encoded><![CDATA[<p>Thanks for the article.  If you are doing this on a ubuntu or debian based system make sure that logrotate is actually installed.  It&#8217;s easy to be fooled since apache and mysql install rotate scripts in /etc/logrotate.d </p>
<p>To install:</p>
<p>sudo apt-get install logrotate</p>
<p>add your new config file to: /etc/logrotate.d</p>
<p>test:</p>
<p>sudo logrotate -d /etc/logrotate.c/my_servers_rotate_script</p>
<p>force a rotate:</p>
<p>sudo logrotate -f /etc/logrotate.c/my_servers_rotate_script</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Holt</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-1337</link>
		<dc:creator>Ryan Holt</dc:creator>
		<pubDate>Wed, 24 Dec 2008 21:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-1337</guid>
		<description>Thanks for the great article! I had just come to the point in building an application where I knew I'd need to solve the log file problem. Definitely a helpful article. I really appreciated the thorough explanations of each configuration option.</description>
		<content:encoded><![CDATA[<p>Thanks for the great article! I had just come to the point in building an application where I knew I&#8217;d need to solve the log file problem. Definitely a helpful article. I really appreciated the thorough explanations of each configuration option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-1214</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Fri, 18 Jul 2008 14:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-1214</guid>
		<description>Thanks for the excellent article! I've tried (following different advice from various sources) using the method suggested by Matt, but I can't get it to work. I will definitely try this method. I feel that in most cases that the job of rotating logs is probably not the job of the application or web server. It's probably debatable as to where this kind of functionality should sit (as is the question of any domain-specific functionality), but it probably comes down to each individual case.</description>
		<content:encoded><![CDATA[<p>Thanks for the excellent article! I&#8217;ve tried (following different advice from various sources) using the method suggested by Matt, but I can&#8217;t get it to work. I will definitely try this method. I feel that in most cases that the job of rotating logs is probably not the job of the application or web server. It&#8217;s probably debatable as to where this kind of functionality should sit (as is the question of any domain-specific functionality), but it probably comes down to each individual case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simply Internet Trash &#187; rotate those rails logs</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-1062</link>
		<dc:creator>Simply Internet Trash &#187; rotate those rails logs</dc:creator>
		<pubDate>Wed, 12 Mar 2008 15:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-1062</guid>
		<description>[...] established a standard deployment location of /usr/local/sites/sitename for our apps. Following this advice I think I&#8217;ll use standard logrotate to move the logs around. I&#8217;ve read that log [...]</description>
		<content:encoded><![CDATA[<p>[...] established a standard deployment location of /usr/local/sites/sitename for our apps. Following this advice I think I&#8217;ll use standard logrotate to move the logs around. I&#8217;ve read that log [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Tarbit</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-912</link>
		<dc:creator>Matt Tarbit</dc:creator>
		<pubDate>Thu, 24 Jan 2008 21:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-912</guid>
		<description>You can actually do log rotation from within rails by adding the following line to the Rails::Initializer.run block in your app's /config/environment.rb:

config.logger = Logger.new(config.log_path, 50, 1024**2)

The 2nd argument being the number of .log files you'd like to keep, and the 3rd being the size in bytes that the files are allowed to reach before they'll be rotated. So this line would keep up to a maximum of 50 1MB files. Not quite as configurable as logrotate perhaps (it doesn't support compression for example), but it's nice to be able to keep all of the config within the app.

See here for more:
http://blog.caboo.se/articles/2005/12/15/who-said-size-is-not-important</description>
		<content:encoded><![CDATA[<p>You can actually do log rotation from within rails by adding the following line to the Rails::Initializer.run block in your app&#8217;s /config/environment.rb:</p>
<p>config.logger = Logger.new(config.log_path, 50, 1024**2)</p>
<p>The 2nd argument being the number of .log files you&#8217;d like to keep, and the 3rd being the size in bytes that the files are allowed to reach before they&#8217;ll be rotated. So this line would keep up to a maximum of 50 1MB files. Not quite as configurable as logrotate perhaps (it doesn&#8217;t support compression for example), but it&#8217;s nice to be able to keep all of the config within the app.</p>
<p>See here for more:<br />
<a href="http://blog.caboo.se/articles/2005/12/15/who-said-size-is-not-important" rel="nofollow">http://blog.caboo.se/articles/2005/12/15/who-said-size-is-not-important</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Lotinsky</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-778</link>
		<dc:creator>Ian Lotinsky</dc:creator>
		<pubDate>Thu, 29 Nov 2007 20:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-778</guid>
		<description>Kevin --

Thanks. I did some more research and discovered that the daily/weekly/monthly option is to specify criteria for backup. So if you have it set to daily and, for some reason, the cron job runs twice, the log(s) will not be rotated.

Of course you can override this behavior with the -f (--force) option.

Thanks for the post!</description>
		<content:encoded><![CDATA[<p>Kevin &#8211;</p>
<p>Thanks. I did some more research and discovered that the daily/weekly/monthly option is to specify criteria for backup. So if you have it set to daily and, for some reason, the cron job runs twice, the log(s) will not be rotated.</p>
<p>Of course you can override this behavior with the -f (&#8211;force) option.</p>
<p>Thanks for the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Skoglund</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-766</link>
		<dc:creator>Kevin Skoglund</dc:creator>
		<pubDate>Mon, 26 Nov 2007 17:02:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-766</guid>
		<description>@Ian: It runs as a cron job, so it will run at whatever time your daily, weekly or monthly cron jobs run.  AFAIK, you can't give it a more specific time.</description>
		<content:encoded><![CDATA[<p>@Ian: It runs as a cron job, so it will run at whatever time your daily, weekly or monthly cron jobs run.  AFAIK, you can&#8217;t give it a more specific time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Lotinsky</title>
		<link>http://www.nullislove.com/2007/09/10/rotating-rails-log-files/comment-page-1/#comment-763</link>
		<dc:creator>Ian Lotinsky</dc:creator>
		<pubDate>Sat, 24 Nov 2007 18:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.nullislove.com/2007/09/10/rotating-rails-log-files/#comment-763</guid>
		<description>Thanks for the great post! Question: is there any way to specify what time you want the rotation to run? If not, is there a standard time it backs up at? Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks for the great post! Question: is there any way to specify what time you want the rotation to run? If not, is there a standard time it backs up at? Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
