<?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: Email log messages library in CodeIgniter</title>
	<atom:link href="http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/</link>
	<description>Having fun with coding</description>
	<lastBuildDate>Sat, 17 Apr 2010 18:58:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: CodeIgniter project best practises (Too many tabs)</title>
		<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/#comment-3010</link>
		<dc:creator>CodeIgniter project best practises (Too many tabs)</dc:creator>
		<pubDate>Mon, 28 Dec 2009 21:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://coding.cglounge.com/?p=231#comment-3010</guid>
		<description>[...] track logged errors is to get them emailed as and when they happen. I found a library extension at http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/, and made a few changes to fix a couple of bugs and use my constant file settings (as explained [...]</description>
		<content:encoded><![CDATA[<p>[...] track logged errors is to get them emailed as and when they happen. I found a library extension at <a href="http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/" rel="nofollow">http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/</a>, and made a few changes to fix a couple of bugs and use my constant file settings (as explained [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/#comment-1126</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Fri, 04 Sep 2009 15:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://coding.cglounge.com/?p=231#comment-1126</guid>
		<description>This is a great idea to be proactive in catching issues on your CI websites. I did something similar and came across this blog when I was getting issues with 404 pages like jg mentioned.

I took your suggestion to use the PHP mail function instead of the CI email class, but the other issue I came across is that I wanted to store things such as the email address to send exceptions to in my config file. I also have a config item to toggle emails on and off since I don&#039;t want to get emails when I&#039;m in development.

The workaround I found was to use the load_class function to load the config class only, so I could access my config vaules. For example:

$cfg =&amp; load_class(&#039;Config&#039;);
$to = $cfg-&gt;config[&#039;exception_to_email_address&#039;];
$from = $cfg-&gt;config[&#039;exception_from_email_address&#039;];

...etc.</description>
		<content:encoded><![CDATA[<p>This is a great idea to be proactive in catching issues on your CI websites. I did something similar and came across this blog when I was getting issues with 404 pages like jg mentioned.</p>
<p>I took your suggestion to use the PHP mail function instead of the CI email class, but the other issue I came across is that I wanted to store things such as the email address to send exceptions to in my config file. I also have a config item to toggle emails on and off since I don&#8217;t want to get emails when I&#8217;m in development.</p>
<p>The workaround I found was to use the load_class function to load the config class only, so I could access my config vaules. For example:</p>
<p>$cfg =&amp; load_class(&#8216;Config&#8217;);<br />
$to = $cfg-&gt;config['exception_to_email_address'];<br />
$from = $cfg-&gt;config['exception_from_email_address'];</p>
<p>&#8230;etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/#comment-291</link>
		<dc:creator>Johan</dc:creator>
		<pubDate>Sat, 06 Jun 2009 21:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://coding.cglounge.com/?p=231#comment-291</guid>
		<description>Cool proposition, I liked it, I haven&#039;t touched the error levels very much yet in CI, but I guess I&#039;ll start using the DEBUG level soon, and well, no need to flood the mailbox with those.

So I added your proposition to the code in the post. Very nice, thanks! :)</description>
		<content:encoded><![CDATA[<p>Cool proposition, I liked it, I haven&#8217;t touched the error levels very much yet in CI, but I guess I&#8217;ll start using the DEBUG level soon, and well, no need to flood the mailbox with those.</p>
<p>So I added your proposition to the code in the post. Very nice, thanks! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jg</title>
		<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/#comment-289</link>
		<dc:creator>jg</dc:creator>
		<pubDate>Sat, 06 Jun 2009 18:47:49 +0000</pubDate>
		<guid isPermaLink="false">http://coding.cglounge.com/?p=231#comment-289</guid>
		<description>My proposition:

if ($result == TRUE &amp;&amp; strtoupper($level) == &#039;ERROR&#039;) { ... }

Email log only for ERROR, not for DEBUG and INFO</description>
		<content:encoded><![CDATA[<p>My proposition:</p>
<p>if ($result == TRUE &amp;&amp; strtoupper($level) == &#8216;ERROR&#8217;) { &#8230; }</p>
<p>Email log only for ERROR, not for DEBUG and INFO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/#comment-288</link>
		<dc:creator>Johan</dc:creator>
		<pubDate>Sat, 06 Jun 2009 17:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://coding.cglounge.com/?p=231#comment-288</guid>
		<description>Hey,
Thanks for the heads up, after some additional research the get_instance() function is not always available to exceptions in CodeIgniter. 404 being one of them.

I updated the library to use the standard PHP mail instead and not rely on CodeIgniter&#039;s mail library, to make sure it always works, no matter how much of CodeIgniter that has been initialized up until the exception occurs.

Try the updated version, and it should work fine now with 404&#039;s, otherwise let me know.

Cheers!</description>
		<content:encoded><![CDATA[<p>Hey,<br />
Thanks for the heads up, after some additional research the get_instance() function is not always available to exceptions in CodeIgniter. 404 being one of them.</p>
<p>I updated the library to use the standard PHP mail instead and not rely on CodeIgniter&#8217;s mail library, to make sure it always works, no matter how much of CodeIgniter that has been initialized up until the exception occurs.</p>
<p>Try the updated version, and it should work fine now with 404&#8217;s, otherwise let me know.</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jg</title>
		<link>http://coding.cglounge.com/2009/05/email-log-messages-library-codeigniter/#comment-286</link>
		<dc:creator>jg</dc:creator>
		<pubDate>Sat, 06 Jun 2009 15:39:20 +0000</pubDate>
		<guid isPermaLink="false">http://coding.cglounge.com/?p=231#comment-286</guid>
		<description>It&#039;s not working if you make a mistake in controller name in URL:
Fatal error: Call to undefined function get_instance() in .../application/libraries/MY_Log.php on line 44

Try http://example.com/wrong_controller_name</description>
		<content:encoded><![CDATA[<p>It&#8217;s not working if you make a mistake in controller name in URL:<br />
Fatal error: Call to undefined function get_instance() in &#8230;/application/libraries/MY_Log.php on line 44</p>
<p>Try <a href="http://example.com/wrong_controller_name" rel="nofollow">http://example.com/wrong_controller_name</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
