create documentation
authorFlorian Semm <floriansemm@apache.org>
Mon, 26 Mar 2012 06:20:19 +0000 (06:20 +0000)
committerFlorian Semm <floriansemm@apache.org>
Mon, 26 Mar 2012 06:20:19 +0000 (06:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/logging/log4php/trunk@1305233 13f79535-47bb-0310-9956-ffa450edef68

src/changes/changes.xml
src/main/php/appenders/LoggerAppenderFirephp.php
src/site/site.xml
src/site/xdoc/docs/appenders/firephp.xml [new file with mode: 0644]

index e18b111..369d30f 100644 (file)
@@ -25,6 +25,7 @@
                        <action date="2011-02-28" type="fix" issue="LOG4PHP-163" dev="Ivan Habunek">Fixed formatting bug in LoggerLayoutPattern.</action>
                        <action date="2011-02-28" type="update" issue="LOG4PHP-172" dev="Ivan Habunek">Rewritten pattern system to allow longer conversion words and some new ones.</action>
                        <action date="2011-02-28" type="add" issue="LOG4PHP-134" dev="Ivan Habunek">Added reconnectAttempts parameter to LoggerAppenderPDO. Adds support for reconnect if connection fails while appending.</action>
+                       <action date="2011-03-26" type="add" issue="LOG4PHP-174" dev="Florian Semm">Firephp appender logs to Firebug console.</action>
                </release>
            <release version="2.2.1" date="2012-02-18">
                <action date="2011-02-07" type="fix" issue="LOG4PHP-168" dev="Ivan Habunek">Fixed a bug which prevented configuration by passing a LoggerConfigurator instance.</action>
index db314f5..5a6d6c6 100644 (file)
 /**
  * Connect Apache Log4php to Insight, the next version of FirePHP
  * Read the link at sourcemint, to <b>define</b> 4 INSIGHT_* constants in your php
- * config / bootstrap
+ * 
+ * LoggerAppenderFirephp logs events by creating a PHP user-level message using the Browser-Extension FirePHP
+ * 
+ * An example php file:
+ * 
+ * {@example ../../examples/php/appender_firephp.php 19}
  *
- * @category  Include
+ * An example configuration file:
+ * 
+ * {@example ../../examples/resources/appender_firephp.xml 18}
+ * 
  * @package   LoggerAppenderFirephp
  * @author    Bruce Ingalls <Bruce.Ingalls-at-gmail-dot-com>
  * @copyright 2012 Apache Software Foundation
  * @license   Apache License, Version 2.0
  * @link      http://sourcemint.com/github.com/firephp/firephp/1:1.0.0b1rc6/-docs/Configuration/Constants
- * @example   define('INSIGHT_IPS', '*');              //If using firephp lib
- * @example   define('INSIGHT_AUTHKEYS', '*');  //weak security (ok for dev only)
- * @example   define('INSIGHT_PATHS', dirname(__FILE__));
- * @example   define('INSIGHT_SERVER_PATH', '/index.php');
  */
 class LoggerAppenderFirephp extends LoggerAppender {
+       
+       /**
+        * 
+        * @var FirePHP instance of FirePHP-Console Client
+        */
        protected $console;
-       protected $medium;
-
+       
        /**
-        * Default constructor
-        *
-        * @param string $name Default ''
+        * 
+        * where to write the log-message
+        * @var string possible values are: page, request, package, contoller, site, page
         */
-       public function __construct($name = '') {
-               parent::__construct($name);
-       }
+       protected $medium;
 
        /**
         * Enable
@@ -106,11 +112,6 @@ class LoggerAppenderFirephp extends LoggerAppender {
                return strtolower($event->getLevel()->toString());
        }
 
-       /**
-        * Disable
-        *
-        * @return void
-        */
        public function close() {
                $this->closed = true;
        }
@@ -151,11 +152,8 @@ class LoggerAppenderFirephp extends LoggerAppender {
         * Sets medium. Defaults to 'page' for firebug console
         *
         * @param string $medium
-        *
-        * @return void
         */
-       public function setMedium($medium='page') {
+       public function setMedium($medium = 'page') {
                $this->setString('medium', $medium);
        }
-
-}
+}
\ No newline at end of file
index c727546..d73a95b 100644 (file)
@@ -57,6 +57,7 @@
                                <item name="LoggerAppenderRollingFile" href="/docs/appenders/rolling-file.html" />
                                <item name="LoggerAppenderSocket" href="/docs/appenders/socket.html" />
                                <item name="LoggerAppenderSyslog" href="/docs/appenders/syslog.html" />
+                               <item name="LoggerAppenderFirephp" href="/docs/appenders/firephp.html" />
                        </item>
                        <item name="Layouts" href="/docs/layouts.html" collapse="true">
                                <item name="LoggerLayoutHtml" href="/docs/layouts/html.html" />
diff --git a/src/site/xdoc/docs/appenders/firephp.xml b/src/site/xdoc/docs/appenders/firephp.xml
new file mode 100644 (file)
index 0000000..2dd01f3
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
\r
+         http://www.apache.org/licenses/LICENSE-2.0\r
\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+-->\r
+<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+       xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">\r
+\r
+       <properties>\r
+               <title>LoggerAppenderFirephp</title>\r
+       </properties>\r
+\r
+       <body>\r
+               <section name="LoggerAppenderFirephp">\r
+               \r
+                       <p><code>LoggerAppenderFirephp</code> logs events by creating a PHP user-level message using the Browser-Extension\r
+                       <code><a href="http://www.firephp.org/" target="_blank" \r
+                       class="externalLink">FirePHP</a></code></p>\r
+               \r
+                       <subsection name="Layout">\r
+                               <p>This appender requires a layout. If no layout is specified in configuration, \r
+                               <code><a href="../layouts/simple.html">LoggerLayoutSimple</a></code> will be used by default.</p>\r
+                       </subsection>   \r
+               \r
+                       <subsection name="Parameters">\r
+                               <p>This appender has no configurable parameters.</p>\r
+                       </subsection>\r
+                               \r
+                       <subsection name="Examples">\r
+\r
+                               <div class="auto-tabs">\r
+                                       <ul>\r
+                                               <li>XML</li>\r
+                                               <li>PHP</li>\r
+                                       </ul>\r
\r
+                                       <div class="tab-content" >\r
+                                               <div class="tab-pane">\r
+<pre class="prettyprint"><![CDATA[\r
+<configuration xmlns="http://logging.apache.org/log4php/">\r
+    <appender name="default" class="LoggerAppenderFirephp">\r
+        <layout class="LoggerLayoutSimple" />\r
+    </appender>\r
+    <root>\r
+        <appender_ref ref="default" />\r
+    </root>\r
+</configuration>\r
+]]></pre>\r
+                                               </div>\r
+                                               <div class="tab-pane">\r
+<pre class="prettyprint"><![CDATA[\r
+array(\r
+    'appenders' => array(\r
+        'default' => array(\r
+            'class' => 'LoggerAppenderFirephp',\r
+            'layout' => array(\r
+                'class' => 'LoggerLayoutSimple',\r
+            ),\r
+        ),\r
+    ),\r
+    'rootLogger' => array(\r
+        'appenders' => array('default'),\r
+    ),\r
+);\r
+]]></pre>\r
+                                               </div>\r
+                                       </div>\r
+                               </div>\r
+                       </subsection>\r
+               </section>\r
+       </body>\r
+</document>\r