Author: ihabunek
Date: Sun Jun 19 21:18:18 2011
New Revision: 1137444

URL: http://svn.apache.org/viewvc?rev=1137444&view=rev
Log:
LOG4PHP-110: Added an example for mongodb appender

Added:
    logging/log4php/trunk/src/examples/php/appender_mongodb.php
    logging/log4php/trunk/src/examples/resources/appender_mongodb.xml

Added: logging/log4php/trunk/src/examples/php/appender_mongodb.php
URL: 
http://svn.apache.org/viewvc/logging/log4php/trunk/src/examples/php/appender_mongodb.php?rev=1137444&view=auto
==============================================================================
--- logging/log4php/trunk/src/examples/php/appender_mongodb.php (added)
+++ logging/log4php/trunk/src/examples/php/appender_mongodb.php Sun Jun 19 
21:18:18 2011
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+require_once dirname(__FILE__).'/../../main/php/Logger.php';
+Logger::configure(dirname(__FILE__).'/../resources/appender_mongodb.xml');
+
+$logger = Logger::getLogger('main');
+$logger->debug("Hello World!");

Added: logging/log4php/trunk/src/examples/resources/appender_mongodb.xml
URL: 
http://svn.apache.org/viewvc/logging/log4php/trunk/src/examples/resources/appender_mongodb.xml?rev=1137444&view=auto
==============================================================================
--- logging/log4php/trunk/src/examples/resources/appender_mongodb.xml (added)
+++ logging/log4php/trunk/src/examples/resources/appender_mongodb.xml Sun Jun 
19 21:18:18 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ 
+         http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"; 
threshold="all">
+    <appender name="default" class="LoggerAppenderMongoDB">
+    </appender>
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</log4php:configuration>


Reply via email to