<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>log4cpp: log4cpp::PatternLayout Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1PatternLayout.html">PatternLayout</a> </div> </div> <div class="contents"> <h1>log4cpp::PatternLayout Class Reference</h1><!-- doxytag: class="log4cpp::PatternLayout" --><!-- doxytag: inherits="log4cpp::Layout" --><a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a> is a simple fixed format <a class="el" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format.">Layout</a> implementation. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="PatternLayout_8hh_source.html">PatternLayout.hh</a>></code> <p> <div class="dynheader"> Inheritance diagram for log4cpp::PatternLayout:</div> <div class="dynsection"> <p><center><img src="classlog4cpp_1_1PatternLayout.png" usemap="#log4cpp::PatternLayout_map" border="0" alt=""></center> <map name="log4cpp::PatternLayout_map"> <area href="classlog4cpp_1_1Layout.html" alt="log4cpp::Layout" shape="rect" coords="0,0,141,24"> </map> </div> <p> <a href="classlog4cpp_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>Classes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout_1_1PatternComponent.html">PatternComponent</a></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#4bca5fb678e85ce0d3fae128b10fc826">PatternLayout</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#fa76336e2b107139407a1d6d41f22a82">~PatternLayout</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#29c5e385c9f13fcfccdee71ef7a25354">format</a> (const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &event)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Formats the <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> in the style set by the setConversionPattern call. <a href="#29c5e385c9f13fcfccdee71ef7a25354"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#40116fcd7bee152b9ea624638c67deeb">setConversionPattern</a> (const std::string &conversionPattern) throw (ConfigureFailure)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the format of log lines handled by this <a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a>. <a href="#40116fcd7bee152b9ea624638c67deeb"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#bd5e458748a48566d203df84c97508b4">getConversionPattern</a> () const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#5df26247f71992097d03999b4eddfb0c">clearConversionPattern</a> ()</td></tr> <tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#d79ee3afde403cd6c6e6ce433b675afb">DEFAULT_CONVERSION_PATTERN</a> = "%m%n"</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The default conversion pattern. <a href="#d79ee3afde403cd6c6e6ce433b675afb"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#eb2b239108ff547920ba43493346a190">SIMPLE_CONVERSION_PATTERN</a> = "%p - %m%n"</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1SimpleLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">SimpleLayout</a>. <a href="#eb2b239108ff547920ba43493346a190"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#f98de13eb4e2881975078fb869dd56e7">BASIC_CONVERSION_PATTERN</a> = "%R %p %c %x: %m%n"</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1BasicLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">BasicLayout</a>. <a href="#f98de13eb4e2881975078fb869dd56e7"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1PatternLayout.html#3ceed9dd11355695346f880a61cceac3">TTCC_CONVERSION_PATTERN</a> = "%r [%t] %p %c %x - %m%n"</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A conversion pattern equivalent to the TTCCLayout. <a href="#3ceed9dd11355695346f880a61cceac3"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a> is a simple fixed format <a class="el" href="classlog4cpp_1_1Layout.html" title="Extend this abstract class to create your own log layout format.">Layout</a> implementation. <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="4bca5fb678e85ce0d3fae128b10fc826"></a><!-- doxytag: member="log4cpp::PatternLayout::PatternLayout" ref="4bca5fb678e85ce0d3fae128b10fc826" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">log4cpp::PatternLayout::PatternLayout </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="fa76336e2b107139407a1d6d41f22a82"></a><!-- doxytag: member="log4cpp::PatternLayout::~PatternLayout" ref="fa76336e2b107139407a1d6d41f22a82" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">log4cpp::PatternLayout::~PatternLayout </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="5df26247f71992097d03999b4eddfb0c"></a><!-- doxytag: member="log4cpp::PatternLayout::clearConversionPattern" ref="5df26247f71992097d03999b4eddfb0c" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::PatternLayout::clearConversionPattern </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="29c5e385c9f13fcfccdee71ef7a25354"></a><!-- doxytag: member="log4cpp::PatternLayout::format" ref="29c5e385c9f13fcfccdee71ef7a25354" args="(const LoggingEvent &event)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string log4cpp::PatternLayout::format </td> <td>(</td> <td class="paramtype">const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> & </td> <td class="paramname"> <em>event</em> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Formats the <a class="el" href="structlog4cpp_1_1LoggingEvent.html" title="The internal representation of logging events.">LoggingEvent</a> in the style set by the setConversionPattern call. <p> By default, set to "%%m%%n" <p>Implements <a class="el" href="classlog4cpp_1_1Layout.html#b52ceda3222f9102e41720b45ae3a939">log4cpp::Layout</a>.</p> </div> </div><p> <a class="anchor" name="bd5e458748a48566d203df84c97508b4"></a><!-- doxytag: member="log4cpp::PatternLayout::getConversionPattern" ref="bd5e458748a48566d203df84c97508b4" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string log4cpp::PatternLayout::getConversionPattern </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="40116fcd7bee152b9ea624638c67deeb"></a><!-- doxytag: member="log4cpp::PatternLayout::setConversionPattern" ref="40116fcd7bee152b9ea624638c67deeb" args="(const std::string &conversionPattern)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void log4cpp::PatternLayout::setConversionPattern </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>conversionPattern</em> </td> <td> ) </td> <td> throw (<a class="el" href="classlog4cpp_1_1ConfigureFailure.html">ConfigureFailure</a>)<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Sets the format of log lines handled by this <a class="el" href="classlog4cpp_1_1PatternLayout.html" title="PatternLayout is a simple fixed format Layout implementation.">PatternLayout</a>. <p> By default, set to "%%m%%n".<br> Format characters are as follows:<br> <b>%%</b> - a single percent sign <b>%c</b> - the category <b>%d</b> - the date<br> Date format: The date format character may be followed by a date format specifier enclosed between braces. For example, %d{%H:%M:%S,%l} or %d{%d %m %Y %H:%M:%S,%l}. If no date format specifier is given then the following format is used: "Wed Jan 02 02:03:55 1980". The date format specifier admits the same syntax as the ANSI C function strftime, with 1 addition. The addition is the specifier %l for milliseconds, padded with zeros to make 3 digits. <b>%m</b> - the message <b>%n</b> - the platform specific line separator <b>%p</b> - the priority <b>%r</b> - milliseconds since this layout was created. <b>%R</b> - seconds since Jan 1, 1970 <b>%u</b> - clock ticks since process start <b>%x</b> - the <a class="el" href="classlog4cpp_1_1NDC.html" title="The NDC class implements nested diagnostic contexts as defined by Neil Harrison in...">NDC</a> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>conversionPattern</em> </td><td>the conversion pattern </td></tr> </table> </dl> <dl compact><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classlog4cpp_1_1ConfigureFailure.html" title="Exception class for configuration.">ConfigureFailure</a></em> </td><td>if the pattern is invalid </td></tr> </table> </dl> </div> </div><p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="f98de13eb4e2881975078fb869dd56e7"></a><!-- doxytag: member="log4cpp::PatternLayout::BASIC_CONVERSION_PATTERN" ref="f98de13eb4e2881975078fb869dd56e7" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#f98de13eb4e2881975078fb869dd56e7">log4cpp::PatternLayout::BASIC_CONVERSION_PATTERN</a> = "%R %p %c %x: %m%n"<code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1BasicLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">BasicLayout</a>. <p> </div> </div><p> <a class="anchor" name="d79ee3afde403cd6c6e6ce433b675afb"></a><!-- doxytag: member="log4cpp::PatternLayout::DEFAULT_CONVERSION_PATTERN" ref="d79ee3afde403cd6c6e6ce433b675afb" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#d79ee3afde403cd6c6e6ce433b675afb">log4cpp::PatternLayout::DEFAULT_CONVERSION_PATTERN</a> = "%m%n"<code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> The default conversion pattern. <p> </div> </div><p> <a class="anchor" name="eb2b239108ff547920ba43493346a190"></a><!-- doxytag: member="log4cpp::PatternLayout::SIMPLE_CONVERSION_PATTERN" ref="eb2b239108ff547920ba43493346a190" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#eb2b239108ff547920ba43493346a190">log4cpp::PatternLayout::SIMPLE_CONVERSION_PATTERN</a> = "%p - %m%n"<code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> A conversion pattern equivalent to the <a class="el" href="classlog4cpp_1_1SimpleLayout.html" title="BasicLayout is a simple fixed format Layout implementation.">SimpleLayout</a>. <p> </div> </div><p> <a class="anchor" name="3ceed9dd11355695346f880a61cceac3"></a><!-- doxytag: member="log4cpp::PatternLayout::TTCC_CONVERSION_PATTERN" ref="3ceed9dd11355695346f880a61cceac3" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char * <a class="el" href="classlog4cpp_1_1PatternLayout.html#3ceed9dd11355695346f880a61cceac3">log4cpp::PatternLayout::TTCC_CONVERSION_PATTERN</a> = "%r [%t] %p %c %x - %m%n"<code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> A conversion pattern equivalent to the TTCCLayout. <p> Note: TTCCLayout is in log4j but not <a class="el" href="namespacelog4cpp.html" title="The top level namespace for all 'Log for C++' types and classes.">log4cpp</a>. </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="PatternLayout_8hh_source.html">PatternLayout.hh</a><li><a class="el" href="PatternLayout_8cpp.html">PatternLayout.cpp</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 19:34:33 2009 for log4cpp by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>