<?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>Andrew Havens Blog &#187; FireBug</title>
	<atom:link href="http://blog.andrewhavens.com/tag/firebug/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.andrewhavens.com</link>
	<description></description>
	<lastBuildDate>Mon, 14 Dec 2009 19:41:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up logging with Firebug and FirePHP in Zend Framework 1.7.5</title>
		<link>http://blog.andrewhavens.com/2009/02/26/setting-up-logging-with-firephpfirebug-in-zend-framework-175/</link>
		<comments>http://blog.andrewhavens.com/2009/02/26/setting-up-logging-with-firephpfirebug-in-zend-framework-175/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 10:40:54 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[FireBug]]></category>
		<category><![CDATA[FirePHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.andrewhavens.com/?p=55</guid>
		<description><![CDATA[ Question: How do I set up logging with FirePHP in Zend Framework?
Answer:

Step 1: Make sure you have Zend Framework 1.6+
Step 2: Install both Firebug and FirePHP extensions for Firefox.
Step 3: Make sure you have Console and Net enabled.\
Step 4: Set up Zend Log in your bootstrap file:



$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);

You can [...]]]></description>
			<content:encoded><![CDATA[<!-- Generated by Digg Digg plugin, 
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/
	--><div style='float:right'><table > <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http%3A%2F%2Fblog.andrewhavens.com%2F2009%2F02%2F26%2Fsetting-up-logging-with-firephpfirebug-in-zend-framework-175%2F&amp;t=Setting+up+logging+with+Firebug+and+FirePHP+in+Zend+Framework+1.7.5&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>Question: How do I set up logging with FirePHP in Zend Framework?</p>
<p>Answer:</p>
<ul>
<li>Step 1: Make sure you have Zend Framework 1.6+</li>
<li>Step 2: Install both Firebug and FirePHP extensions for Firefox.</li>
<li>Step 3: Make sure you have Console and Net enabled.\</li>
<li>Step 4: Set up Zend Log in your bootstrap file:</li>
</ul>
<pre class="brush: php;">

$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
</pre>
<p>You can now send a log message to Firebug with the following code (in your bootstrap file):</p>
<pre class="brush: php;">

$logger-&gt;log('Hello World!', Zend_Log::DEBUG);
</pre>
<p>If you wanted to use the logger outside of your bootstrap file, you can set $logger in the session:</p>
<pre class="brush: php;">

Zend_Registry::set('logger', $logger);

$logger = Zend_Registry::get('logger');
$logger-&gt;log('This is my log message', Zend_Log::INFO);
</pre>
<p>However, when I want to debug, I don&#8217;t want a bunch of lines or characters when I just want to output something to the logger. So I prefer to make a function in my bootstrap file that can be used throughout my application:</p>
<pre class="brush: php;">

$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
Zend_Registry::set('logger', $logger);

function debug($message) {
$logger = Zend_Registry::get('logger');
$logger-&gt;debug($message);
}
</pre>
<p>That way, in my I can use by simply calling:</p>
<pre class="brush: php;">

debug('hello!');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrewhavens.com/2009/02/26/setting-up-logging-with-firephpfirebug-in-zend-framework-175/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
