<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Fri, 24 May 2013 09:40:39 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Logging with PSR-3 to Improve Reusability]]></title>
      <guid>http://www.phpdeveloper.org/news/19148</guid>
      <link>http://www.phpdeveloper.org/news/19148</link>
      <description><![CDATA[<p>
On PHPMaster.com <i>Patrick Mulvey</i> has written up a new  tutorial looking at <a href="http://phpmaster.com/logging-with-psr-3-to-improve-reusability/">using the PSR-3 logging structure</a> to make a basic logger for your application.
</p>
<blockquote>
Logging is one of the most ubiquitous tasks encountered in PHP. We use logs to track error messages, record important events, and debug problems with our code. In any PHP project, the code is likely to be full of calls to a logging library which handles these actions for us. [...] To promote compatibility between logging libraries, the PHP-FIG group recently released PRS-3, a common interface for logger objects. In this article, I'll discuss how the logger interface defined by PSR-3 allows us to write reusable code that isn't dependent on any particular logging implementation.
</blockquote>
<p>
He includes a quick introduction to the PSR-3 format, how to get the files you'll need to use it (via Composer). He includes some sample code showing how to make the basic email class with a logger injected for use. Since the Monolog logging project follows the PSR-3 format, it's an easy drop-in option. He also talks about using PSR-3 to avoid having logger dependencies with the "LoggerInterface". There's also a bit at the end of the tutorial showing you how to use the Adapter design pattern to "proxy" the logging calls to the class via a PSR-3 interface.
</p>]]></description>
      <pubDate>Thu, 07 Feb 2013 10:22:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jeremy Cook: Turbocharging your Logs]]></title>
      <guid>http://www.phpdeveloper.org/news/18550</guid>
      <link>http://www.phpdeveloper.org/news/18550</link>
      <description><![CDATA[<p>
In a new post to his site <i>Jeremy Cook</i> <a href="http://jeremycook.ca/2012/10/02/turbocharging-your-logs/">introduces you to Graylog2</a>, a <a href="http://graylog2.org/">logging server</a> that can aggregate messages from multiple sources/feeds into one consolidated location.
</p>
<blockquote>
Graylog stores them in a database and allows you to perform custom searches on them. You can also see in real time how many log messages are being received and processed. The real killer feature in Graylog is streams. A stream in Graylog is a predefined custom search. The server will display to you log messages that only match the stream criteria selected, graphing the results for you. 
</blockquote>
<p>
He mentions other features of the Graylog2 system including customized alerts, messaging via UDP/AMQP and how it uses MongoDb and ElasticSearch. He also introduces <a href="https://github.com/Seldaek/monolog">Monolog</a>, a PHP tool that lets you log in multiple formats directly to the Graylog2 server. He includes an example of how it works with a sample "LoggingHelper" added as custom <a href="set_exception_handler">exception</a> and <a href="set_error_handler">error</a> handlers.
</p>]]></description>
      <pubDate>Wed, 03 Oct 2012 10:07:30 -0500</pubDate>
    </item>
  </channel>
</rss>
