logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1187897 - in /logging/log4php/trunk/src/site: apt/docs/layouts.apt site.xml xdoc/docs/layouts/serialized.xml
Date Sun, 23 Oct 2011 14:47:21 GMT
Author: ihabunek
Date: Sun Oct 23 14:47:21 2011
New Revision: 1187897

URL: http://svn.apache.org/viewvc?rev=1187897&view=rev
Log:
LOG4PHP-155: Documentation for LoggerLayoutSerialized (also replaced layouts.apt page which
somehow disappeared, probably my fault :))

Added:
    logging/log4php/trunk/src/site/apt/docs/layouts.apt
    logging/log4php/trunk/src/site/xdoc/docs/layouts/serialized.xml
Modified:
    logging/log4php/trunk/src/site/site.xml

Added: logging/log4php/trunk/src/site/apt/docs/layouts.apt
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/site/apt/docs/layouts.apt?rev=1187897&view=auto
==============================================================================
--- logging/log4php/trunk/src/site/apt/docs/layouts.apt (added)
+++ logging/log4php/trunk/src/site/apt/docs/layouts.apt Sun Oct 23 14:47:21 2011
@@ -0,0 +1,47 @@
+~~ 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.
+ ------
+Appender Layout
+ ------
+ ------
+ ------
+
+Appender Layout
+
+  Layouts are components responsible for transforming a logging event into a string.
+
+  More often than not, users wish to customize not only the output destination but also the
output format. This is 
+  accomplished by associating a layout with an appender. All messages logged by that appender
will use the given layout. 
+
+* Available Layouts
+
+  The following layouts are included with Apache log4php:
+
+*---------------------------------------------------------+--------------+
+|| Name                                                   || Description
+*---------------------------------------------------------+--------------+
+| {{{./layouts/html.html}LoggerLayoutHTML}}               | Outputs events in a HTML table.
+*---------------------------------------------------------+--------------+
+| {{{./layouts/pattern.html}LoggerLayoutPattern}}         | A flexible layout configurable
via a pattern string.
+*---------------------------------------------------------+--------------+
+| {{{./layouts/simple.html}LoggerLayoutSimple}}           | A simple, non configurable layout.
+*---------------------------------------------------------+--------------+
+| {{{./layouts/serialized.html}LoggerLayoutSerialized}}   | Outputs serialized objects.
+*---------------------------------------------------------+--------------+
+| {{{./layouts/ttcc.html}LoggerLayoutTTCC}}               | Consists of <<T>>ime,
<<T>>hread, <<C>>ategory and nested diagnostic <<C>>ontext
information
+*---------------------------------------------------------+--------------+
+| {{{./layouts/xml.html}LoggerLayoutXml}}                 | Outputs events as an XML document.
+*---------------------------------------------------------+--------------+
+

Modified: logging/log4php/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/site/site.xml?rev=1187897&r1=1187896&r2=1187897&view=diff
==============================================================================
--- logging/log4php/trunk/src/site/site.xml (original)
+++ logging/log4php/trunk/src/site/site.xml Sun Oct 23 14:47:21 2011
@@ -75,6 +75,7 @@
 			<item name="Layouts" href="/docs/layouts.html" collapse="true">
 				<item name="LoggerLayoutHtml" href="/docs/layouts/html.html" />
 				<item name="LoggerLayoutPattern" href="/docs/layouts/pattern.html" />
+				<item name="LoggerLayoutSerialized" href="/docs/layouts/serialized.html" />
 				<item name="LoggerLayoutSimple" href="/docs/layouts/simple.html" />
 				<item name="LoggerLayoutTTCC" href="/docs/layouts/ttcc.html" />
 				<item name="LoggerLayoutXml" href="/docs/layouts/xml.html" />

Added: logging/log4php/trunk/src/site/xdoc/docs/layouts/serialized.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/site/xdoc/docs/layouts/serialized.xml?rev=1187897&view=auto
==============================================================================
--- logging/log4php/trunk/src/site/xdoc/docs/layouts/serialized.xml (added)
+++ logging/log4php/trunk/src/site/xdoc/docs/layouts/serialized.xml Sun Oct 23 14:47:21 2011
@@ -0,0 +1,90 @@
+<?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.
+-->
+<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+
+	<properties>
+		<title>LoggerLayoutSerialized</title>
+	</properties>
+
+	<body>
+		<section name="LoggerLayoutSerialized">
+		
+			<p><code>LoggerLayoutSerialized</code> formats the logging event using
the PHP's 
+			<code><a href="http://php.net/manual/en/function.serialize.php">serialize()</a></code>
function.</p>
+			
+			<subsection name="Options" id="Options">
+				<p>The following options are available:</p>
+		
+				<table>
+					<tr>
+						<th>Parameter</th>
+						<th>Type</th>
+						<th>Required</th>
+						<th>Default</th>
+						<th>Description</th>
+					</tr>
+					<tr>
+						<td>locationInfo</td>
+						<td>boolean</td>
+						<td>No</td>
+						<td>false</td>
+						<td>If set to true, it will initilaize the event's location information before
serialization. 
+						This option makes logging slower and should be used only if required.</td>
+					</tr>
+				</table>
+				
+			</subsection>
+				
+			<subsection name="Examples">
+				
+				<p>Sample configuration file:</p>
+					
+<pre class="prettyprint"><![CDATA[
+<configuration xmlns="http://logging.apache.org/log4php/">
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutSerialized" />
+    </appender>
+    <root>
+        <appender_ref ref="default" />
+    </root>
+</configuration>
+]]></pre>
+
+				<p>Running the following code:</p>
+
+<pre class="prettyprint linenums">
+Logger::configure("config.xml");
+$logger = Logger::getLogger('myLogger');
+$logger->info("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+$logger->debug("Donec a diam lectus.");
+$logger->warn("Sed sit amet ipsum mauris.");
+</pre>
+
+				<p>Produces the following output:</p>
+
+<pre class="prettyprint linenums"><![CDATA[
+O:18:"LoggerLoggingEvent":10:{s:24:" LoggerLoggingEvent fqcn";s:6:"Logger";s:32:" LoggerLoggingEvent
categoryName";s:8:"myLogger";s:8:" * level";O:11:"LoggerLevel":3:{s:18:" LoggerLevel level";i:20000;s:21:"
LoggerLevel levelStr";s:4:"INFO";s:29:" LoggerLevel syslogEquivalent";i:6;}s:23:" LoggerLoggingEvent
ndc";N;s:37:" LoggerLoggingEvent ndcLookupRequired";b:1;s:27:" LoggerLoggingEvent message";s:56:"Lorem
ipsum dolor sit amet, consectetur adipiscing elit.";s:35:" LoggerLoggingEvent renderedMessage";N;s:30:"
LoggerLoggingEvent threadName";N;s:9:"timeStamp";d:1319380554.782227;s:32:" LoggerLoggingEvent
locationInfo";N;}
+O:18:"LoggerLoggingEvent":10:{s:24:" LoggerLoggingEvent fqcn";s:6:"Logger";s:32:" LoggerLoggingEvent
categoryName";s:8:"myLogger";s:8:" * level";O:11:"LoggerLevel":3:{s:18:" LoggerLevel level";i:10000;s:21:"
LoggerLevel levelStr";s:5:"DEBUG";s:29:" LoggerLevel syslogEquivalent";i:7;}s:23:" LoggerLoggingEvent
ndc";N;s:37:" LoggerLoggingEvent ndcLookupRequired";b:1;s:27:" LoggerLoggingEvent message";s:20:"Donec
a diam lectus.";s:35:" LoggerLoggingEvent renderedMessage";N;s:30:" LoggerLoggingEvent threadName";N;s:9:"timeStamp";d:1319380554.78247;s:32:"
LoggerLoggingEvent locationInfo";N;}
+O:18:"LoggerLoggingEvent":10:{s:24:" LoggerLoggingEvent fqcn";s:6:"Logger";s:32:" LoggerLoggingEvent
categoryName";s:8:"myLogger";s:8:" * level";O:11:"LoggerLevel":3:{s:18:" LoggerLevel level";i:30000;s:21:"
LoggerLevel levelStr";s:4:"WARN";s:29:" LoggerLevel syslogEquivalent";i:4;}s:23:" LoggerLoggingEvent
ndc";N;s:37:" LoggerLoggingEvent ndcLookupRequired";b:1;s:27:" LoggerLoggingEvent message";s:26:"Sed
sit amet ipsum mauris.";s:35:" LoggerLoggingEvent renderedMessage";N;s:30:" LoggerLoggingEvent
threadName";N;s:9:"timeStamp";d:1319380554.78268;s:32:" LoggerLoggingEvent locationInfo";N;}
+]]></pre>
+			</subsection>
+
+		</section>
+	</body>
+</document>



Mime
View raw message