Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Log_Writer_Syslog Component Proposal

Proposed Component Name Zend_Log_Writer_Syslog
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Log_Writer_Syslog
Proposers Thomas Gelf
Zend Liaison Matthew Weier O'Phinney
Revision 1.0 - 19 September 2008: Posted to mailing list, created proposal after getting some feedback
1.1 - 24 September 2008: Removed Exceptions as PHP doesn't behave as documentation says
1.2 - 27 September 2008: Added "Multi-Instance-Capability" (wiki revision: 21)

Table of Contents

1. Overview

Zend_Log_Writer_Syslog implements a syslog writer for Zend_Log.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

4. Dependencies on Other Framework Components

  • Zend_Log_Writer_Abstract

5. Theory of Operation

This component implements a syslog writer for Zend_Log.

Syslog benefits:

  • There are lots of tools taking care of logfile rotation and such jobs
  • You can scale out your application and easily centralize your logs
  • Fast, small overhead

6. Milestones / Tasks

  • Milestone 1: [DONE] Initial class design
  • Milestone 2: [DONE] Create prototype
  • Milestone 3: [DONE] Finish proposal and submit for community review
  • Milestone 4: Create unit tests

7. Class Index

  • Zend_Log_Writer_Syslog

8. Use Cases

UC-01
UC-02
UC-03
UC-04

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
proposal proposal Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 24, 2008

    <p>Are the error suppressors before syslog and openlog really needed? Because they are expensive PHP-wise. I would like to see a better handling if possible.</p>

    <p>Otherwise this is greatly appreciated and needed <ac:emoticon ac:name="smile" /></p>

    1. Sep 24, 2008

      <p>No - so I removed them. After some discussion on ZF's mailing lists, some tests, ptraces and also greps through PHP's source code I discovered that:</p>

      <ul>
      <li>openlog(), closelog() and syslog() will never fail</li>
      <li>feel free to try it out, even killing /dev/log leads to no error</li>
      </ul>

      <p>So I removed all checks for return values, removed exceptions and dependency on Zend_Log_Exception. Not much code left so far <ac:emoticon ac:name="wink" /></p>

      1. Sep 28, 2008

        <p>thats great. this really looks very promising.</p>

  2. Sep 24, 2008

    <p>Some thoughts regarding multiple instances of this writer:</p>

    <ul>
    <li>PHP's openlog() function has a "global character"</li>
    <li>Therefore currently a second syslog writer using a different log facility and / or application name would overwrite the other writer's settings</li>
    <li>Calling openlog() is cheap and you can call it as many times as you want. Calling it before each syslog()-call would work, but I wouldn't like to do so, it doesn't seem the correct way of handling this</li>
    <li>I could solve this issue using two static and two non-static variables holding current writer settings (app & facility) and the last used ones (in the "global" scope). If one of them has changed, openlog() needs to be called again</li>
    </ul>

    <p>Probably most users won't even care about this, one syslog facility and app-name is more than enough - but I would like to do things the right way, so any feedback regarding these thoughts is appreciated!</p>

    <p>Cheers,<br />
    Thomas</p>

    1. Sep 26, 2008

      <p>I extended the proposal as suggested (by myself) - multiple instances are now handled automagically (see UC-04).</p>

  3. Oct 15, 2008

    <p>Looks good, isn't it ready for review now?</p>

  4. Oct 31, 2008

    <ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Acceptance</ac:parameter><ac:rich-text-body>
    <p>This proposal is accepted for immediate development in the standard incubator.</p></ac:rich-text-body></ac:macro>

  5. Mar 18, 2009

    <p>Has this proposal been abandoned? Please reply here.</p>

    1. Apr 08, 2009

      <p>No, I'm just too lazy for writing tests <ac:emoticon ac:name="wink" /></p>

      <p>I'll try to do so within April - any idea how to test whether a log line made it to syslog or not?</p>

      <p>Cheers,<br />
      Thomas</p>

  6. Jul 30, 2009

    <p>No news ? <ac:emoticon ac:name="sad" /></p>

    1. Aug 02, 2009

      <p>Matthew finished docs and cleaned up the code - Zend_Log_Writer_Syslog is part of ZF 1.9.0 <ac:emoticon ac:name="smile" /></p>

      <p>Cheers,<br />
      Thomas</p>