<?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: Reusable Logging in Django Apps</title>
	<atom:link href="http://mihasya.com/blog/reusable-logging-in-django-apps/feed/" rel="self" type="application/rss+xml" />
	<link>http://mihasya.com/blog/reusable-logging-in-django-apps/</link>
	<description>good things now come in packages of three</description>
	<lastBuildDate>Sat, 23 Jul 2011 22:40:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: mihasya</title>
		<link>http://mihasya.com/blog/reusable-logging-in-django-apps/comment-page-1/#comment-141</link>
		<dc:creator>mihasya</dc:creator>
		<pubDate>Tue, 03 Mar 2009 07:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=237#comment-141</guid>
		<description>&lt;p&gt;The reason for storing it in the settings.py file is that you can then import from django.conf.settings, which is universal - you can move your app into another project and just define a LOGGER in that project&#039;s settings.py. That is also the reason for the silent swap for the generic logger - if you have a LOGGER or generic logging configured, it&#039;ll just work. If you haven&#039;t configured logging at all, the log output will just go to stdout, so it&#039;s not entirely silent. It&#039;s not optimal, but my goal was to create a way for apps to be able to use a project-wide logger w/o making too big a fuss about it. If you really NEED the logs and have them configured, you will very quickly notice that the output isn&#039;t coming, and will then have an easy way to fix it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The reason for storing it in the settings.py file is that you can then import from django.conf.settings, which is universal &#8211; you can move your app into another project and just define a LOGGER in that project&#8217;s settings.py. That is also the reason for the silent swap for the generic logger &#8211; if you have a LOGGER or generic logging configured, it&#8217;ll just work. If you haven&#8217;t configured logging at all, the log output will just go to stdout, so it&#8217;s not entirely silent. It&#8217;s not optimal, but my goal was to create a way for apps to be able to use a project-wide logger w/o making too big a fuss about it. If you really NEED the logs and have them configured, you will very quickly notice that the output isn&#8217;t coming, and will then have an easy way to fix it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Upadhyay</title>
		<link>http://mihasya.com/blog/reusable-logging-in-django-apps/comment-page-1/#comment-140</link>
		<dc:creator>Amit Upadhyay</dc:creator>
		<pubDate>Tue, 03 Mar 2009 05:11:19 +0000</pubDate>
		<guid isPermaLink="false">http://mihasya.com/blog/?p=237#comment-140</guid>
		<description>&lt;p&gt;Nice tip.&lt;/p&gt;

&lt;p&gt;I tend to store all my logging related settings to loggers.py and loggers.cfg in the same place as settings.py. And from each module I do a &quot;from myproject.loggers import mail_logger as logger&quot; and so on.&lt;/p&gt;

&lt;p&gt;But don&#039;t you think silently trapping exceptions like missing logger might be a recipe of future trouble. Least you should do when silently dropping errors is to log it, here you can&#039;t even do that.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nice tip.</p>

<p>I tend to store all my logging related settings to loggers.py and loggers.cfg in the same place as settings.py. And from each module I do a &#8220;from myproject.loggers import mail_logger as logger&#8221; and so on.</p>

<p>But don&#8217;t you think silently trapping exceptions like missing logger might be a recipe of future trouble. Least you should do when silently dropping errors is to log it, here you can&#8217;t even do that.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

