Author: grobmeier
Date: Mon Sep 7 05:42:45 2009
New Revision: 812001
URL: http://svn.apache.org/viewvc?rev=812001&view=rev
Log:
Patch from Christian Hammers: phpdoc and APT docs make use of example files.
Modified:
incubator/log4php/trunk/src/examples/php/mail.php
incubator/log4php/trunk/src/examples/php/syslog.php
incubator/log4php/trunk/src/examples/resources/mail.properties
incubator/log4php/trunk/src/examples/resources/syslog.properties
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php
incubator/log4php/trunk/src/site/apt/docs/appenders.apt
Modified: incubator/log4php/trunk/src/examples/php/mail.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/examples/php/mail.php?rev=812001&r1=812000&r2=812001&view=diff
==============================================================================
--- incubator/log4php/trunk/src/examples/php/mail.php (original)
+++ incubator/log4php/trunk/src/examples/php/mail.php Mon Sep 7 05:42:45 2009
@@ -15,9 +15,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+// START SNIPPET: foo
require_once dirname(__FILE__).'/../../main/php/Logger.php';
Logger::configure(dirname(__FILE__).'/../resources/mail.properties');
$logger = Logger::getRootLogger();
$logger->fatal("Some critical message!");
+// END SNIPPET: foo
?>
Modified: incubator/log4php/trunk/src/examples/php/syslog.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/examples/php/syslog.php?rev=812001&r1=812000&r2=812001&view=diff
==============================================================================
--- incubator/log4php/trunk/src/examples/php/syslog.php (original)
+++ incubator/log4php/trunk/src/examples/php/syslog.php Mon Sep 7 05:42:45 2009
@@ -15,9 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+// START SNIPPET: foo
require_once dirname(__FILE__).'/../../main/php/Logger.php';
Logger::configure(dirname(__FILE__).'/../resources/syslog.properties');
$logger = Logger::getRootLogger();
$logger->fatal("Hello World!");
+// END SNIPPET: foo
?>
Modified: incubator/log4php/trunk/src/examples/resources/mail.properties
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/examples/resources/mail.properties?rev=812001&r1=812000&r2=812001&view=diff
==============================================================================
--- incubator/log4php/trunk/src/examples/resources/mail.properties (original)
+++ incubator/log4php/trunk/src/examples/resources/mail.properties Mon Sep 7
05:42:45 2009
@@ -15,9 +15,11 @@
; See the License for the specific language governing permissions and
; limitations under the License.
;
+; START SNIPPET: foo
log4php.appender.email = LoggerAppenderMail
log4php.appender.email.layout = LoggerLayoutTTCC
log4php.appender.email.from = [email protected]
log4php.appender.email.to = [email protected]
log4php.appender.email.subject = Log4php test
log4php.rootLogger = FATAL, email
+; END SNIPPET: foo
\ No newline at end of file
Modified: incubator/log4php/trunk/src/examples/resources/syslog.properties
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/examples/resources/syslog.properties?rev=812001&r1=812000&r2=812001&view=diff
==============================================================================
--- incubator/log4php/trunk/src/examples/resources/syslog.properties (original)
+++ incubator/log4php/trunk/src/examples/resources/syslog.properties Mon Sep 7
05:42:45 2009
@@ -15,8 +15,10 @@
; See the License for the specific language governing permissions and
; limitations under the License.
;
+; START SNIPPET: foo
log4php.appender.default = LoggerAppenderSyslog
log4php.appender.default.layout = LoggerLayoutSimple
log4php.appender.default.ident = log4php-test
log4php.appender.default.facility = LOG_LOCAL0
log4php.rootLogger = DEBUG, default
+; END SNIPPET: foo
\ No newline at end of file
Modified:
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php?rev=812001&r1=812000&r2=812001&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php
(original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSyslog.php Mon
Sep 7 05:42:45 2009
@@ -21,13 +21,15 @@
* Log events using php {...@link PHP_MANUAL#syslog} function.
*
* Levels are mapped as follows:
- * - <b>level >= FATAL</b> to LOG_ALERT
- * - <b>FATAL > level >= ERROR</b> to LOG_ERR
- * - <b>ERROR > level >= WARN</b> to LOG_WARNING
- * - <b>WARN > level >= INFO</b> to LOG_INFO
- * - <b>INFO > level >= DEBUG</b> to LOG_DEBUG
+ * - <b>level >= FATAL</b> to LOG_ALERT
+ * - <b>FATAL > level >= ERROR</b> to LOG_ERR
+ * - <b>ERROR > level >= WARN</b> to LOG_WARNING
+ * - <b>WARN > level >= INFO</b> to LOG_INFO
+ * - <b>INFO > level >= DEBUG</b> to LOG_DEBUG
*
* @version $Revision$
+ * @example ../../examples/php/syslog.php An example how to use the
LoggerAppenderSyslog class
+ * @example ../../examples/resources/syslog.properties Configuration example
* @package log4php
* @subpackage appenders
*/
Modified: incubator/log4php/trunk/src/site/apt/docs/appenders.apt
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/site/apt/docs/appenders.apt?rev=812001&r1=812000&r2=812001&view=diff
==============================================================================
--- incubator/log4php/trunk/src/site/apt/docs/appenders.apt (original)
+++ incubator/log4php/trunk/src/site/apt/docs/appenders.apt Mon Sep 7 05:42:45
2009
@@ -236,6 +236,11 @@
subject | Sets the subject of the mail
*-------------------*-----------------------------------------------------*
+ Examples:
+
+%{snippet|id=foo|file=src/examples/php/mail.php}
+
+%{snippet|id=foo|file=src/examples/resources/mail.properties}
** LoggerAppenderMailEvent
@@ -335,4 +340,10 @@
| This value is used as a parameter for
php openlog()
| and passed on to the syslog daemon.
*-------------------*-----------------------------------------------------*
+
+ Examples:
+
+%{snippet|id=foo|file=src/examples/php/syslog.php}
+
+%{snippet|id=foo|file=src/examples/resources/syslog.properties}