<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Helion-Prime Solutions blog &#187; Rails</title>
	<atom:link href="http://blogs.helion-prime.com/tag/rails/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.helion-prime.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 10 May 2010 17:51:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Log rotation in Ruby on Rails applications</title>
		<link>http://blogs.helion-prime.com/2009/11/19/log-rotation-in-ruby-on-rails-applications.html</link>
		<comments>http://blogs.helion-prime.com/2009/11/19/log-rotation-in-ruby-on-rails-applications.html#comments</comments>
		<pubDate>Thu, 19 Nov 2009 12:30:04 +0000</pubDate>
		<dc:creator>alex.shapovalov</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://blogs.helion-prime.com/?p=623</guid>
		<description><![CDATA[preamble
Even on mid-size applications logs grow enormously fast, it&#8217;s a pity Rails doesn&#8217;t provide built-in functionality for that like Apache web-server does. Fortunately there is an easy and fast solution for that issue.
1. Install cronolog
“cronolog [http://cronolog.org/] is a simple filter program that reads log file entries from standard input and writes each entry to the [...]]]></description>
			<content:encoded><![CDATA[<h2>preamble</h2>
<p>Even on mid-size applications logs grow enormously fast, it&#8217;s a pity Rails doesn&#8217;t provide built-in functionality for that like Apache web-server does. Fortunately there is an easy and fast solution for that issue.</p>
<h2>1. Install cronolog</h2>
<p>“cronolog [<a href="http://cronolog.org/">http://cronolog.org/</a>] is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time.”</p>
<p>For details, and list of parameters see: [<a href="http://cronolog.org/usage.html">http://cronolog.org/usage.html</a>]</p>
<p>On GNU/Linux Debian:</p>
<pre># apt-get install cronolog</pre>
<h2>2. Setup your Rails application</h2>
<p>Edit necessary environment file: like &#8216;config/environments/production.rb&#8217; file</p>
<div class="codecolorer-container ruby mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;"># system logger configuration</span><br />
<span style="color:#008000; font-style:italic;"># config.logger = SyslogLogger.new</span><br />
<br />
config.<span style="color:#9900CC;">logger</span> = <span style="color:#CC00FF; font-weight:bold;">Logger</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">IO</span>.<span style="color:#9900CC;">popen</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;FULL_PATH_TO_CRONOLOG log/production.log.%Y%m%d&quot;</span>, <span style="color:#996600;">&quot;w&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
config.<span style="color:#9900CC;">logger</span>.<span style="color:#9900CC;">level</span> = <span style="color:#CC00FF; font-weight:bold;">Logger</span>::INFO</div></td></tr></tbody></table></div>
<p>That&#8217;s all, fast and easy .. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.helion-prime.com/2009/11/19/log-rotation-in-ruby-on-rails-applications.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
