<?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>Sun, 19 May 2013 20:13:17 -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[Chris Hartjes: Standards, Soapboxes, and Shamans]]></title>
      <guid>http://www.phpdeveloper.org/news/19070</guid>
      <link>http://www.phpdeveloper.org/news/19070</link>
      <description><![CDATA[<p>
In <a href="http://www.littlehart.net/atthekeyboard/2013/01/20/standards-soapboxes-and-shamans/">this latest post</a> to his site <i>Chris Hartjes</i> shares some of his thoughts about the recently approved <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">PSR-3</a> standard (for logging) and some of the reception that the other PSRs (PSR-0, 1 & 2) have gotten from the PHP community.
</p>
<blockquote>
For those who pay attention to the workings of the PHP community you might have heard about the "PHP Standards Recommendations" that have been coming out of the PHP Framwork Interop Group. [...] More recently this group has been working on a standard for logging interfaces called <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">PSR-3</a>. I spoke about this on Twitter, and I will repeat it here: I think PHP programmers should get behind PSR-0 and efforts like PSR-3. I feel that PSR-1 and PSR-2 are solutions looking for a problem and seem, to me anyway, to me out of place with the solutions offered by PSR-0 and PSR-3.
</blockquote>
<p>
He likens the PHP PSRs to the <a href="http://www.python.org/dev/peps/">Python enhancement proposals</a> (PEPs) and, more specifically, to the PEP-8 - their own version of "coding standards" that was highly championed by <i>Guido van Rossum</i> and put into wide practice. 
</p>
<blockquote>
Any programming language community that does not work as hard as possible to make it easier to integrate other's libraries of code together [by standardizing their formatting] is asking for irrelevancy.
</blockquote>]]></description>
      <pubDate>Mon, 21 Jan 2013 13:16:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Implementing PSR-3 with log4php]]></title>
      <guid>http://www.phpdeveloper.org/news/19039</guid>
      <link>http://www.phpdeveloper.org/news/19039</link>
      <description><![CDATA[<p>
With the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">PSR-3</a> logging interface recently accepted by the PHP-FIG, <i>Jamie Munro</i> has written up a post for PHPMaster.com that shows how to <a href="http://phpmaster.com/implementing-psr-3-with-log4php/">implement the interface with log4php</a>, the <a href="http://logging.apache.org/log4php/">Apache logging tool</a>.
</p>
<blockquote>
With the recent passage of PSR-3, a standard for a common interface for logging libraries, it seems appropriate to discuss the implementation with my favorite logging library. log4php is an open source Apache project that is a very versatile logging framework. Through log4php's configuration files, logging has a variety of output locations, so it's possible to send specific log levels to different output locations. 
</blockquote>
<p>
He includes the Composer requirements for the interface and shares the code for a wrapper class that implements the Logger interface and defines methods for each of the logging levels (alert, notice, debug, etc). Also in the post is an example XML configuration for log4php and how to load it into your class instance.
</p>]]></description>
      <pubDate>Tue, 15 Jan 2013 12:53:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: PSR-3 Accepted - Logger Interface]]></title>
      <guid>http://www.phpdeveloper.org/news/19037</guid>
      <link>http://www.phpdeveloper.org/news/19037</link>
      <description><![CDATA[<p>
The PHP-FIG  (Framework Interoperability Group) has recently <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">accepted the PSR-3 definition</a> for a standardized Logger interface structure that can be used for interoperability between frameworks (and other tools).
</p>
<blockquote>
The main goal is to allow libraries to receive a PsrLogLoggerInterface object and write logs to it in a simple and universal way. Frameworks and CMSs that have custom needs MAY extend the interface for their own purpose, but SHOULD remain compatible with this document. This ensures that the third-party libraries an application uses can write to the centralized application logs.
</blockquote>
<p>
The <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">implementation of this structure</a> into your application makes it easier should you decide to swap out logging tools or want to create your own that can be used across several different frameworks. This is the third PSR to be accepted by the group, following <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md">PSR-1</a> and <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">PSR-2</a> more related to coding standards.
</p>]]></description>
      <pubDate>Tue, 15 Jan 2013 10:55:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stuart Herbert: Personal Thoughts On The PSR-3 Log Proposal]]></title>
      <guid>http://www.phpdeveloper.org/news/18971</guid>
      <link>http://www.phpdeveloper.org/news/18971</link>
      <description><![CDATA[<p>
In his latest post, <i>Stuart Herbert</i> has <a href="http://blog.stuartherbert.com/php/2012/12/29/personal-thoughts-on-the-psr-3-log-proposal/">shared some thoughts</a> about the recently proposed PSR-3 proposal for a unified logging interface for PHP projects.
</p>
<blockquote>
PSR-3 is a proposed standard (<a href="https://groups.google.com/forum/?fromgroups=#!topic/php-fig/d0yPC7jWPAE">voting</a> has finished, it should appear as an accepted standard when the PSR folks recover from too much Christmas turkey) describing a common logging interface for PHP frameworks. It's based on a small subsection of <a href="http://tools.ietf.org/html/rfc5424">RFC 5424</a>, which describes the Syslog standard, which is a very sensible choice. Sysadmins think in terms of Syslog levels, and they utterly hate dealing with loggers that don't map cleanly onto Syslog.
</blockquote>
<p>
He briefly introduces the PSR and the format of the logger with some of the main methods it should implement and what they do. He talk gets into some of his critiques about the proposal, namely the method naming, the exception handling parameter and the proposed LogLevel constants.
</p>]]></description>
      <pubDate>Mon, 31 Dec 2012 10:46:13 -0600</pubDate>
    </item>
  </channel>
</rss>
