blob: 70411f6d526555155e4ea5f72490ad495372cd99 [file] [log] [blame]
<html>
<head>
<title>
log4cxx - Documentation
</title>
<link href="../css/doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<!-- START Header table -->
<table border="0" cellspacing="0" width="90%">
<!-- TOP IMAGE -->
<tr>
<td colspan="2">
<a href="http://logging.apache.org">
<img src="http://logging.apache.org/images/ls-logo.jpg" align="left" border="0"/>
</a>
</td>
</tr>
</table>
<!-- END Header table -->
<!-- START main table -->
<table id="main" border="0" width="90%" cellspacing="2" cellpadding="0">
<tr><td colspan="2">
<hr noshade="" size="1"/>
</td></tr>
<tr>
<!-- LEFT SIDE NAVIGATION -->
<td id="navbar" valign="top">
<!-- ============================================================ -->
<table id="navbar" border="0" cellspacing="0" cellpadding="0">
<tr >
<td class="navbarHeader" nowrap="true">
<strong>Apache</strong>
</td>
</tr>
<tr><td class="navbarItem"><small> <a href="http://www.apache.org">Apache Home</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="http://logging.apache.org/">Logging Services</a>
</small></td></tr>
<tr >
<td class="navbarHeader" nowrap="true">
<strong>log4cxx project</strong>
</td>
</tr>
<tr><td class="navbarItem"><small> <a href="../index.html">About</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../news.html">News</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../team.html">Team</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../manual/index.html">Documentation</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../performance.html">Performance</a>
</small></td></tr>
<tr><td class="navbarItem"><small> <a href="../download.html">Download</a>
</small></td></tr>
</table>
</td>
<td id="mainContents" align="left" valign="top">
<hr>
<!-- Generated by Doxygen 1.3.5 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a></div>
<h1>PatternLayout Class Reference</h1>Inheritance diagram for PatternLayout:<p><center><img src="classlog4cxx_1_1PatternLayout__inherit__graph.png" border="0" usemap="#PatternLayout__inherit__map" alt="Inheritance graph"></center>
<map name="PatternLayout__inherit__map">
<area href="classlog4cxx_1_1Layout.html" shape="rect" coords="84,168,134,192" alt="">
<area href="classlog4cxx_1_1spi_1_1OptionHandler.html" shape="rect" coords="6,93,102,117" alt="">
<area href="classlog4cxx_1_1helpers_1_1Object.html" shape="rect" coords="84,19,134,43" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="126,93,201,117" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for PatternLayout:<p><center><img src="classlog4cxx_1_1PatternLayout__coll__graph.png" border="0" usemap="#PatternLayout__coll__map" alt="Collaboration graph"></center>
<map name="PatternLayout__coll__map">
<area href="classlog4cxx_1_1Layout.html" shape="rect" coords="69,173,120,197" alt="">
<area href="classlog4cxx_1_1spi_1_1OptionHandler.html" shape="rect" coords="6,96,102,120" alt="">
<area href="classlog4cxx_1_1helpers_1_1Object.html" shape="rect" coords="90,18,141,42" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectImpl.html" shape="rect" coords="126,96,201,120" alt="">
<area href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html" shape="rect" coords="144,173,216,197" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cxx_1_1PatternLayout-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a0">PatternLayout</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a1">PatternLayout</a> (const String &amp;pattern)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a2">setConversionPattern</a> (const String &amp;conversionPattern)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>String&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a3">getConversionPattern</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a4">activateOptions</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a5">setOption</a> (const String &amp;option, const String &amp;value)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a6">ignoresThrowable</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a7">format</a> (ostream &amp;output, const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &amp;event) const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a8">setTimeZone</a> (const String &amp;timeZone)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const String &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#a9">getTimeZone</a> () const </td></tr>
<tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>String&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#s0">DEFAULT_CONVERSION_PATTERN</a> = _T("%m%n")</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>String&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#s1">TTCC_CONVERSION_PATTERN</a> = _T("%r [%t] %p %c %x - %m%n")</td></tr>
<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">helpers::PatternConverterPtr</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classlog4cxx_1_1PatternLayout.html#b0">createPatternParser</a> (const String &amp;pattern)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A flexible layout configurable with pattern string.<p>
The goal of this class is to <a class="el" href="classlog4cxx_1_1PatternLayout.html#a7">format</a> a <a class="el" href="classlog4cxx_1_1spi_1_1LoggingEvent.html">LoggingEvent</a> and return the results as a string. The results depend on the <em>conversion pattern</em>.<p>
The conversion pattern is closely related to the conversion pattern of the printf function in C. A conversion pattern is composed of literal text and format control expressions called <em>conversion specifiers</em>.<p>
<em>You are free to insert any literal text within the conversion pattern.</em><p>
Each conversion specifier starts with a percent sign (%) and is followed by optional <em>format modifiers</em> and a <em>conversion character</em>. The conversion character specifies the type of data, e.g. logger, priority, date, thread name. The format modifiers control such things as field width, padding, left and right justification. The following is a simple example.<p>
Let the conversion pattern be <b>"\%-5p [\%t]: \%m\%n"</b> and assume that the log4cxx environment was set to use a <a class="el" href="classlog4cxx_1_1PatternLayout.html">PatternLayout</a>. Then the statements <pre><div>
LoggerPtr root = Logger::getRoot();
root-&gt;debug("Message 1");
root-&gt;warn("Message 2");
</pre></div> would yield the output <pre><div>
DEBUG [main]: Message 1
WARN [main]: Message 2
</pre></div><p>
Note that there is no explicit separator between text and conversion specifiers. The pattern parser knows when it has reached the end of a conversion specifier when it reads a conversion character. In the example above the conversion specifier <b>%-5p</b> means the priority of the logging event should be left justified to a width of five characters.<p>
The recognized conversion characters are<p>
<table border="1" cellpadding="8" cellspacing="3">
<tr>
<td align="center"><b>Conversion Character</b> </td><td align="center"><b>Effect</b> <p>
</td></tr>
<tr>
<td align="center"><b>c</b><p>
</td><td>Used to output the logger of the logging event. The logger conversion specifier can be optionally followed by <em>precision specifier</em>, that is a decimal constant in brackets.<p>
<p>
If a precision specifier is given, then only the corresponding number of right most components of the logger name will be printed. By default the logger name is printed in full.<p>
<p>
For example, for the logger name "a.b.c" the pattern <b>%c{2}</b> will output "b.c".<p>
<p>
</td></tr>
<tr>
<td align="center"><b>d</b> </td><td>Used to output the date of the logging event. The date conversion specifier may be followed by a <em>date format specifier</em> enclosed between braces. For example, <b>%d{%H:%M:%S}</b> or <b>%d{%d&nbsp;%b&nbsp;%Y&nbsp;%H:%M:%S}</b>. If no date format specifier is given then <a class="el" href="classlog4cxx_1_1helpers_1_1ISO8601DateFormat.html">ISO8601 format</a> is assumed.<p>
<p>
The Following format options are possible:<ul>
<li>a -- Abbreviated weekday name</li><li>A -- Full weekday name</li><li>b -- Abbreviated month name</li><li>B -- Full month name</li><li>c -- Standard date and time string</li><li>d -- Day of month as a decimal(1-31)</li><li>H -- Hour(0-23)</li><li>I -- Hour(1-12)</li><li>j -- Day of year as a decimal(1-366)</li><li>m -- Month as decimal(1-12)</li><li>M -- Minute as decimal(00-59)</li><li>p -- Locale's equivalent of AM or PM</li><li>Q -- Millisecond as decimal (000-999)</li><li>S -- Second as decimal(00-59)</li><li>U -- Week of year, Sunday being first day(0-53)</li><li>w -- Weekday as a decimal(0-6, Sunday being 0)</li><li>W -- Week of year, Monday being first day(0-53)</li><li>x -- Standard date string</li><li>X -- Standard time string</li><li>y -- Year in decimal without century(0-99)</li><li>Y -- Year including century as decimal</li><li>Z -- Time zone name</li><li>% -- The percent sign</li></ul>
<p>
<p>
Lookup the documentation for the <code>strftime()</code> function found in the <code>&lt;ctime&gt;</code> header for more information.<p>
<p>
You can alos use the log4cxx predefined date formatters. These can be specified using one of the strings "ABSOLUTE", "DATE" and "ISO8601" for specifying <a class="el" href="classlog4cxx_1_1helpers_1_1AbsoluteTimeDateFormat.html">AbsoluteTimeDateFormat</a>, <a class="el" href="classlog4cxx_1_1helpers_1_1DateTimeDateFormat.html">DateTimeDateFormat</a> and respectively <a class="el" href="classlog4cxx_1_1helpers_1_1ISO8601DateFormat.html">ISO8601DateFormat</a>. For example, <b>%d{ISO8601}</b> or <b>%d{ABSOLUTE}</b>.<p>
<p>
</td></tr>
<tr>
<td align="center"><b>F</b><p>
</td><td>Used to output the file name where the logging request was issued.<p>
<p>
<b>WARNING</b> Generating caller location information is extremely slow. It's use should be avoided unless execution speed is not an issue.<p>
<p>
</td></tr>
<tr>
<td align="center"><b>l</b><p>
</td><td>Used to output location information of the caller which generated the logging event.<p>
<p>
The location information can be very useful. However, it's generation is <em>extremely</em> slow. It's use should be avoided unless execution speed is not an issue.<p>
<p>
</td></tr>
<tr>
<td align="center"><b>L</b><p>
</td><td>Used to output the line number from where the logging request was issued.<p>
<p>
<b>WARNING</b> Generating caller location information is extremely slow. It's use should be avoided unless execution speed is not an issue.<p>
<p>
</td></tr>
<tr>
<td align="center"><b>m</b> </td><td>Used to output the application supplied message associated with the logging event. <p>
</td></tr>
<tr>
<td align="center"><b>n</b><p>
</td><td>Outputs the platform dependent line separator character or characters.<p>
<p>
This conversion character offers practically the same performance as using non-portable line separator strings such as "\n", or "\r\n". Thus, it is the preferred way of specifying a line separator.<p>
<p>
</td></tr>
<tr>
<td align="center"><b>p</b> </td><td>Used to output the level(priority) of the logging event. <p>
</td></tr>
<tr>
<td align="center"><b>r</b><p>
</td><td>Used to output the number of milliseconds elapsed since the start of the application until the creation of the logging event. <p>
</td></tr>
<tr>
<td align="center"><b>t</b><p>
</td><td>Used to output the name of the thread that generated the logging event.<p>
<p>
</td></tr>
<tr>
<td align="center"><b>x</b><p>
</td><td>Used to output the <a class="el" href="classlog4cxx_1_1NDC.html">NDC</a> (nested diagnostic context) associated with the thread that generated the logging event. <p>
</td></tr>
<tr>
<td align="center"><b>X</b><p>
</td><td><p>
<p>
Used to output the <a class="el" href="classlog4cxx_1_1MDC.html">MDC</a> (mapped diagnostic context) associated with the thread that generated the logging event. The <b>X</b> conversion character <em>must</em> be followed by the key for the map placed between braces, as in <b>%X{clientNumber}</b> where <code>clientNumber</code> is the key. The value in the <a class="el" href="classlog4cxx_1_1MDC.html">MDC</a> corresponding to the key will be output.<p>
<p>
See <a class="el" href="classlog4cxx_1_1MDC.html">MDC</a> class for more details. <p>
<p>
</td></tr>
<tr>
<td align="center"><b>%</b><p>
</td><td>The sequence %% outputs a single percent sign. <p>
</td></tr>
</table>
<p>
By default the relevant information is output as is. However, with the aid of format modifiers it is possible to change the minimum field width, the maximum field width and justification.<p>
The optional format modifier is placed between the percent sign and the conversion character.<p>
The first optional format modifier is the <em>left justification flag</em> which is just the minus (-) character. Then comes the optional <em>minimum field width</em> modifier. This is a decimal constant that represents the minimum number of characters to output. If the data item requires fewer characters, it is padded on either the left or the right until the minimum width is reached. The default is to pad on the left (right justify) but you can specify right padding with the left justification flag. The padding character is space. If the data item is larger than the minimum field width, the field is expanded to accommodate the data. The value is never truncated.<p>
This behavior can be changed using the <em>maximum field width</em> modifier which is designated by a period followed by a decimal constant. If the data item is longer than the maximum field, then the extra characters are removed from the <em>beginning</em> of the data item and not from the end. For example, it the maximum field width is eight and the data item is ten characters long, then the first two characters of the data item are dropped. This behavior deviates from the printf function in C where truncation is done from the end.<p>
Below are various format modifier examples for the logger conversion specifier.<p>
<table border="1" cellpadding="8" cellspacing="3">
<tr>
<td align="center"><b>Format modifier</b> </td><td align="center"><b>left justify</b> </td><td align="center"><b>minimum width</b> </td><td align="center"><b>maximum width</b> </td><td align="center"><b>comment</b> <p>
</td></tr>
<tr>
<td align="center">%20c </td><td align="center">false </td><td align="center">20 </td><td align="center">none<p>
</td><td>Left pad with spaces if the logger name is less than 20 characters long.<p>
</td></tr>
<tr>
<td align="center">%-20c </td><td align="center">true </td><td align="center">20 </td><td align="center">none </td><td>Right pad with spaces if the logger name is less than 20 characters long.<p>
</td></tr>
<tr>
<td align="center">%.30c </td><td align="center">NA </td><td align="center">none </td><td align="center">30<p>
</td><td>Truncate from the beginning if the logger name is longer than 30 characters.<p>
</td></tr>
<tr>
<td align="center">%20.30c </td><td align="center">false </td><td align="center">20 </td><td align="center">30<p>
</td><td>Left pad with spaces if the logger name is shorter than 20 characters. However, if logger name is longer than 30 characters, then truncate from the beginning.<p>
</td></tr>
<tr>
<td align="center">%-20.30c </td><td align="center">true </td><td align="center">20 </td><td align="center">30<p>
</td><td>Right pad with spaces if the logger name is shorter than 20 characters. However, if logger name is longer than 30 characters, then truncate from the beginning.<p>
</td></tr>
</table>
<p>
Below are some examples of conversion patterns.<p>
<b>%r [%t] %-5p %c %x - %m<br>
</b> <p>
This is essentially the TTCC layout.<p>
<b>%-6r [%15.15t] %-5p %30.30c %x - %m<br>
</b><p>
Similar to the TTCC layout except that the relative time is right padded if less than 6 digits, thread name is right padded if less than 15 characters and truncated if longer and the logger name is left padded if shorter than 30 characters and truncated if longer.<p>
The above text is largely inspired from Peter A. Darnell and Philip E. Margolis' highly recommended book "C -- a Software Engineering Approach", ISBN 0-387-97389-3.
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a0" doxytag="log4cxx::PatternLayout::PatternLayout" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classlog4cxx_1_1PatternLayout.html">PatternLayout</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Does nothing </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="log4cxx::PatternLayout::PatternLayout" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classlog4cxx_1_1PatternLayout.html">PatternLayout</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>pattern</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Constructs a <a class="el" href="classlog4cxx_1_1PatternLayout.html">PatternLayout</a> using the supplied conversion pattern. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a4" doxytag="log4cxx::PatternLayout::activateOptions" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void activateOptions </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Call createPatternParser
<p>
Implements <a class="el" href="classlog4cxx_1_1spi_1_1OptionHandler.html#a1">OptionHandler</a>. </td>
</tr>
</table>
<a class="anchor" name="b0" doxytag="log4cxx::PatternLayout::createPatternParser" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">PatternConverterPtr</a> createPatternParser </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>pattern</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [protected, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns head of PatternParser used to parse the conversion string. Subclasses may override this to return a subclass of PatternParser which recognize custom conversion characters. </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="log4cxx::PatternLayout::format" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void format </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">ostream &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>output</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1ObjectPtrT.html">spi::LoggingEventPtr</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>event</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Produces a formatted string as specified by the conversion pattern.
<p>
Implements <a class="el" href="classlog4cxx_1_1Layout.html#a1">Layout</a>. </td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="log4cxx::PatternLayout::getConversionPattern" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> String getConversionPattern </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the value of the <b>ConversionPattern</b> option. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="log4cxx::PatternLayout::getTimeZone" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const String&amp; getTimeZone </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns value of the <b>TimeZone</b> option. </td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="log4cxx::PatternLayout::ignoresThrowable" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual bool ignoresThrowable </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The <a class="el" href="classlog4cxx_1_1PatternLayout.html">PatternLayout</a> does not handle the throwable contained within <a class="el" href="classlog4cxx_1_1spi_1_1LoggingEvent.html">LoggingEvents</a>. Thus, it returns <code>true</code>.
<p>
Implements <a class="el" href="classlog4cxx_1_1Layout.html#a5">Layout</a>. </td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="log4cxx::PatternLayout::setConversionPattern" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void setConversionPattern </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>conversionPattern</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the <b>ConversionPattern</b> option. This is the string which controls formatting and consists of a mix of literal content and conversion specifiers. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="log4cxx::PatternLayout::setOption" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void setOption </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>option</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const String &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set <code>option</code> to <code>value</code>.<p>
The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when <a class="el" href="classlog4cxx_1_1PatternLayout.html#a4">activateOptions</a> is called.
<p>
Implements <a class="el" href="classlog4cxx_1_1spi_1_1OptionHandler.html#a2">OptionHandler</a>. </td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="log4cxx::PatternLayout::setTimeZone" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void setTimeZone </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const String &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>timeZone</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The <b>TimeZoneID</b> option is a time zone ID string in the format expected by the <code>locale</code> C++ standard class. </td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="s0" doxytag="log4cxx::PatternLayout::DEFAULT_CONVERSION_PATTERN" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> String <a class="el" href="classlog4cxx_1_1PatternLayout.html#s0">DEFAULT_CONVERSION_PATTERN</a> = _T("%m%n")<code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Default pattern string for log output. Currently set to the string <b>"\%m\%n"</b> which just prints the application supplied message. </td>
</tr>
</table>
<a class="anchor" name="s1" doxytag="log4cxx::PatternLayout::TTCC_CONVERSION_PATTERN" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> String <a class="el" href="classlog4cxx_1_1PatternLayout.html#s1">TTCC_CONVERSION_PATTERN</a> = _T("%r [%t] %p %c %x - %m%n")<code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
A conversion pattern equivalent to the TTCCCLayout. Current value is <b>%r [%t] %p %c %x - %m%n</b>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li>patternlayout.h<li>patternlayout.cpp</ul>
</td>
</tr>
<!-- FOOTER -->
<tr><td colspan="2">
<hr noshade="" size="1"/>
</td></tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright &#169; 1999-2004, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
<!-- END main table -->
</body>
</html>
<!-- end the processing -->