blob: 97033e282eb9eb10fe45b7acdc4ebdb13e71b5bd [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Oct 13, 2012 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache log4php -
LoggerLayoutHTML - Apache log4php</title>
<link rel="stylesheet" href="../../css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../../css/site.css" type="text/css" />
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/prettify.min.js"></script>
<script type="text/javascript" src="../../js/site.js"></script>
<meta name="Date-Revision-yyyymmdd" content="20121013" />
<meta http-equiv="Content-Language" content="en" />
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26177991-1']);
_gaq.push (['_gat._anonymizeIp']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="composite">
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="http://logging.apache.org/log4php">Apache log4php &trade;</a>
<ul class="nav">
<li>
<a href="../../index.html" title="About">About</a>
</li>
<li>
<a href="../../download.html" title="Download">Download</a>
</li>
<li>
<a href="../../install.html" title="Install">Install</a>
</li>
<li>
<a href="../../quickstart.html" title="Quick start">Quick start</a>
</li>
</ul>
<!-- Twitter link -->
<ul class="nav pull-right">
<li><a href="http://twitter.com/log4php/" class="external">Follow <strong>@log4php</strong></a></li>
</ul>
<!-- Google CSE Search Box -->
<form class="navbar-search pull-right" id="cref" action="http://www.google.com/cse">
<input type="hidden" name="cref" value="http://logging.apache.org/log4php/cse.xml" />
<input class="search-query pull-left" type="text" name="q" size="40" placeholder="Search" />
</form>
</div>
</div>
</div>
<div class="container-fluid">
<table class="layout-table">
<tr>
<td class="sidebar">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-home"></i>Apache log4php™</li>
<li class="none">
<a href="../../index.html" title="About">About</a>
</li>
<li class="none">
<a href="../../download.html" title="Download">Download</a>
</li>
<li class="none">
<a href="../../install.html" title="Install">Install</a>
</li>
<li class="none">
<a href="../../changelog.html" title="Changelog">Changelog</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-book"></i>Documentation</li>
<li class="none">
<a href="../../quickstart.html" title="Quick start">Quick start</a>
</li>
<li class="none">
<a href="../../docs/introduction.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="../../docs/configuration.html" title="Configuration">Configuration</a>
</li>
<li class="none">
<a href="../../docs/loggers.html" title="Loggers">Loggers</a>
</li>
<li class="collapsed">
<a href="../../docs/appenders.html" title="Appenders">Appenders</a>
</li>
<li class="expanded">
<a href="../../docs/layouts.html" title="Layouts">Layouts</a>
<ul>
<li class="none active">
<a href="../../docs/layouts/html.html" title="LoggerLayoutHtml">LoggerLayoutHtml</a>
</li>
<li class="none">
<a href="../../docs/layouts/pattern.html" title="LoggerLayoutPattern">LoggerLayoutPattern</a>
</li>
<li class="none">
<a href="../../docs/layouts/serialized.html" title="LoggerLayoutSerialized">LoggerLayoutSerialized</a>
</li>
<li class="none">
<a href="../../docs/layouts/simple.html" title="LoggerLayoutSimple">LoggerLayoutSimple</a>
</li>
<li class="none">
<a href="../../docs/layouts/ttcc.html" title="LoggerLayoutTTCC">LoggerLayoutTTCC</a>
</li>
<li class="none">
<a href="../../docs/layouts/xml.html" title="LoggerLayoutXml">LoggerLayoutXml</a>
</li>
</ul>
</li>
<li class="none">
<a href="../../docs/filters.html" title="Filters">Filters</a>
</li>
<li class="none">
<a href="../../docs/renderers.html" title="Renderers">Renderers</a>
</li>
<li class="none">
<a href="../../apidocs/index.html" title="API documentation">API documentation</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-user"></i>Community</li>
<li class="none">
<a href="../../volunteering.html" title="Volunteering">Volunteering</a>
</li>
<li class="none">
<a href="../../contributingpatches.html" title="Contributing Patches">Contributing Patches</a>
</li>
<li class="none">
<a href="http://wiki.apache.org/logging-log4php" class="external" target="_blank" title="Wiki">Wiki</a>
</li>
<li class="none">
<a href="http://blogs.apache.org/logging/" class="external" target="_blank" title="Blog">Blog</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-info-sign"></i>Project Information</li>
<li class="none">
<a href="../../integration.html" title="Continuous Integration">Continuous Integration</a>
</li>
<li class="none">
<a href="../../source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li class="none">
<a href="../../dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li class="none">
<a href="../../license.html" title="Project License">Project License</a>
</li>
<li class="none">
<a href="../../team-list.html" title="Project Team">Project Team</a>
</li>
<li class="none">
<a href="../../issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
<li class="none">
<a href="../../mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-cog"></i>Project Reports</li>
<li class="none">
<a href="../../changes-report.html" title="Changes Report">Changes Report</a>
</li>
<li class="none">
<a href="../../surefire-report.html" title="Surefire Report">Surefire Report</a>
</li>
<li class="none">
<a href="../../rat-report.html" title="RAT Report">RAT Report</a>
</li>
<li class="none">
<a href="../../coverage-report/index.html" title="Code Coverage">Code Coverage</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-heart"></i>Apache</li>
<li class="none">
<a href="http://www.apache.org" class="external" target="_blank" title="Home">Home</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/sponsorship.html" class="external" target="_blank" title="Sponsorship">Sponsorship</a>
</li>
<li class="none">
<a href="http://www.apache.org/licenses/" class="external" target="_blank" title="License">License</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/thanks.html" class="external" target="_blank" title="Thanks">Thanks</a>
</li>
<li class="none">
<a href="http://www.apachecon.com" class="external" target="_blank" title="Conferences">Conferences</a>
</li>
<li class="none">
<a href="http://www.apache.org/security/" class="external" target="_blank" title="Security">Security</a>
</li>
</ul>
</div>
<div id="poweredBy">
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" />
</a>
</div>
</td>
<td class="content">
<!-- 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. -->
<a name="LoggerLayoutHTML"></a><div class="section" id="LoggerLayoutHTML"><h2>LoggerLayoutHTML<a name="LoggerLayoutHTML"></a></h2>
<p>LoggerLayoutHTML formats the log as an HTML document.</p>
<div class="section"><h3>Parameters<a name="Parameters"></a></h3>
<p>The following parameters are available:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>locationInfo</td>
<td>boolean</td>
<td>No</td>
<td>false</td>
<td>If set to true, adds the file name and line number at which the log statement originated.</td>
</tr>
<tr class="a">
<td>title</td>
<td>string</td>
<td>No</td>
<td>Log4php Log Messages</td>
<td>Sets the &lt;title&gt; of the generated HTML document.</td>
</tr>
</tbody>
</table>
</div>
<div class="section"><h3>Examples<a name="Examples"></a></h3>
<p>Configuration:</p>
<div class="auto-tabs">
<ul>
<li>XML</li>
<li>PHP</li>
</ul>
<div class="tab-content">
<div class="tab-pane">
<div><pre class="prettyprint linenums">
&lt;configuration xmlns=&quot;http://logging.apache.org/log4php/&quot;&gt;
&lt;appender name=&quot;default&quot; class=&quot;LoggerAppenderEcho&quot;&gt;
&lt;layout class=&quot;LoggerLayoutHtml&quot;&gt;
&lt;param name=&quot;locationInfo&quot; value=&quot;true&quot; /&gt;
&lt;/layout&gt;
&lt;/appender&gt;
&lt;root&gt;
&lt;appender_ref ref=&quot;default&quot; /&gt;
&lt;/root&gt;
&lt;/configuration&gt;
</pre></div>
</div>
<div class="tab-pane">
<div><pre class="prettyprint linenums">
array(
'appenders' =&gt; array(
'default' =&gt; array(
'class' =&gt; 'LoggerAppenderEcho',
'layout' =&gt; array(
'class' =&gt; 'LoggerLayoutHtml',
)
)
),
'rootLogger' =&gt; array(
'appenders' =&gt; array('default')
),
)
</pre></div>
</div>
</div>
</div>
<p>Running the following code:</p>
<div><pre class="prettyprint linenums">
Logger::configure(&quot;layout_xml.xml&quot;);
$log = Logger::getRootLogger();
$log-&gt;debug(&quot;Hello World!&quot;);
$log-&gt;info(&quot;Hello World!&quot;);
</pre></div>
<p>Produces the output as a HTML table:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th>Time</th>
<th>Thread</th>
<th>Level</th>
<th>Category</th>
<th>File:Line</th>
<th>Message</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>0</td>
<td title="5868 thread">5868</td>
<td title="Level"><font color="#339933">DEBUG</font></td>
<td title="root category">root</td>
<td>D:\Projects\apache\log4php-config-adapters\src\examples\php\layout_html.php:23</td>
<td title="Message">Hello World!</td>
</tr>
<tr class="a">
<td>2</td>
<td title="5868 thread">5868</td>
<td title="Level">INFO</td>
<td title="root category">root</td>
<td>D:\Projects\apache\log4php-config-adapters\src\examples\php\layout_html.php:24</td>
<td title="Message">Hello World!</td>
</tr>
</tbody>
</table>
<p>Source of the output:</p>
<div><pre class="prettyprint">
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Log4php Log Messages&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
body, table {font-family: arial,sans-serif; font-size: x-small;}
th {background: #336699; color: #FFFFFF; text-align: left;}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body bgcolor=&quot;#FFFFFF&quot; topmargin=&quot;6&quot; leftmargin=&quot;6&quot;&gt;
&lt;hr size=&quot;1&quot; noshade&gt;
Log session start time 09/22/11 13:19:23&lt;br&gt;
&lt;br&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;4&quot; border=&quot;1&quot; bordercolor=&quot;#224466&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Thread&lt;/th&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;File:Line&lt;/th&gt;
&lt;th&gt;Message&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td title=&quot;5868 thread&quot;&gt;5868&lt;/td&gt;
&lt;td title=&quot;Level&quot;&gt;&lt;font color=&quot;#339933&quot;&gt;DEBUG&lt;/font&gt;&lt;/td&gt;
&lt;td title=&quot;root category&quot;&gt;root&lt;/td&gt;
&lt;td&gt;D:\Projects\apache\log4php-config-adapters\src\examples\php\layout_html.php:23&lt;/td&gt;
&lt;td title=&quot;Message&quot;&gt;Hello World!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td title=&quot;5868 thread&quot;&gt;5868&lt;/td&gt;
&lt;td title=&quot;Level&quot;&gt;INFO&lt;/td&gt;
&lt;td title=&quot;root category&quot;&gt;root&lt;/td&gt;
&lt;td&gt;D:\Projects\apache\log4php-config-adapters\src\examples\php\layout_html.php:24&lt;/td&gt;
&lt;td title=&quot;Message&quot;&gt;Hello World!&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div>
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="footer">
<p>Copyright &#169; 2012
<a href="http://www.apache.org">Apache Software Foundation</a>.
All Rights Reserved.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License, Version 2.0</a>.
Please read the <a href="../../privacy.html">Privacy policy</a></p>
<p>Apache log4php, Apache, log4php, the Apache feather logo, the Apache Logging Services project logo and the Built by
Maven logo are trademarks of The Apache Software Foundation.</p>
<p>Site powered by <a class="external" href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>. Icons from
<a class="external" href="http://glyphicons.com/">Glyphicons Free</a>.</p>
</div>
</body>
</html>