svn commit: r1384 - in logback/trunk/logback-site/src/site/pages: css manual templates

Author: ceki Date: Fri Mar 2 21:55:39 2007 New Revision: 1384 Modified: logback/trunk/logback-site/src/site/pages/css/site.css logback/trunk/logback-site/src/site/pages/manual/introduction.html logback/trunk/logback-site/src/site/pages/manual/layouts.html logback/trunk/logback-site/src/site/pages/templates/right.js Log: ongoing work Modified: logback/trunk/logback-site/src/site/pages/css/site.css ============================================================================== --- logback/trunk/logback-site/src/site/pages/css/site.css (original) +++ logback/trunk/logback-site/src/site/pages/css/site.css Fri Mar 2 21:55:39 2007 @@ -248,6 +248,12 @@ .green { color: green; } + +.white_bg { + background-color: #FFFFFF; +} + + .blue { color: blue; } Modified: logback/trunk/logback-site/src/site/pages/manual/introduction.html ============================================================================== --- logback/trunk/logback-site/src/site/pages/manual/introduction.html (original) +++ logback/trunk/logback-site/src/site/pages/manual/introduction.html Fri Mar 2 21:55:39 2007 @@ -17,43 +17,12 @@ <script src="../templates/right.js"></script> </div> <div id="content"> - <h2>Introduction</h2> - <div class="author"> - Authors: Ceki Gülcü, Sébastien Pennec - </div> - - <table class="bodyTable"> - <tr class="a"> - <td valign="top" align="top"> - <a rel="license" - href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> - <img alt="Creative Commons License" - style="border-width: 0" - src="http://creativecommons.org/images/public/somerights20.png" /> - </a> - </td> - <td> - <p>Copyright © 2000-2006, QOS.ch</p> - - <p> - <!--Creative Commons License--> - This work is licensed under a - <a rel="license" - href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> - Creative Commons - Attribution-NonCommercial-ShareAlike 2.5 - License - </a> - . - <!--/Creative Commons License--> - </p> - </td> - </tr> - </table> + <h1>Introduction</h1> + <script src="../templates/creative.js"></script> - <h2>Introduction</h2> + <h2>What is logback?</h2> <p> Logback is intended as a successor to the popular log4j project. Modified: logback/trunk/logback-site/src/site/pages/manual/layouts.html ============================================================================== --- logback/trunk/logback-site/src/site/pages/manual/layouts.html (original) +++ logback/trunk/logback-site/src/site/pages/manual/layouts.html Fri Mar 2 21:55:39 2007 @@ -20,41 +20,9 @@ </div> <div id="content"> - <h2>Chapter 5: Layouts</h2> - <div class="author"> - Authors: Ceki Gülcü, Sébastien Pennec - </div> - - - <table cellpadding="10"> - - <tr> - <td> - <a rel="license" - href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> - <img alt="Creative Commons License" - style="border-width: 0" - src="http://creativecommons.org/images/public/somerights20.png" /> - </a> - </td> - <td> - <p>Copyright © 2000-2006, QOS.ch</p> - - <p> - <!--Creative Commons License--> - This document is licensed under a - <a rel="license" - href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> - Creative Commons - Attribution-NonCommercial-ShareAlike 2.5 - License - </a> - - <!--/Creative Commons License--> - </p> - </td> - </tr> - </table> + <h1>Chapter 5: Layouts</h1> + + <script src="../templates/creative.js"></script> <div class="highlight"> @@ -65,7 +33,7 @@ </p> </div> - <h2>What is a layout</h2> + <h2>What is a layout?</h2> <p>While appenders are responsible for writing logging output to an appender dependent device, layouts are responsible for the @@ -281,16 +249,16 @@ <!-- ====================== XXXXXXXXXXXXx --> + <p>The addition of the corresponding setter method is all that is needed to enable the configuration of an option. Note that the - <code>PrintThreadName</code> attribute is a boolean and not a - <code>String</code>. It can be configured anyway by writing - <em>true</em> of <em>false</em> in the configuration - file.Configuration of logback components was covered in detail in - <a href="chapter3.html">"Chapter 3: Logback configuration with - Joran"</a>. Here is a configuration file adapted for - <code>MySampleLayout2</code>. - </p> + <code>PrintThreadName</code> option is boolean and not + <code>String</code>. Configuration of logback components was + covered in detail in <a href="joran.html">"Chapter 3: Logback + configuration with Joran"</a>. Here is the configuration file + tailor-made for use with <code>MySampleLayout2</code>. + </p> + <div class="source"><pre><configuration> @@ -317,13 +285,13 @@ <h3>PatternLayout</h3> <p> - Logback classic ships with a flexible layout called - <a href="../xref/ch/qos/logback/classic/PatternLayout.html"> - <code>PatternLayout</code></a>. - As all classic layouts, <code>PatternLayout</code> - takes a logging event and returns a String. However, the - returned String can be customized at will by tweaking its - conversion pattern. + Logback classic ships with a flexible layout called <a + href="../xref/ch/qos/logback/classic/PatternLayout.html"> + <code>PatternLayout</code></a>. As all layouts, + <code>PatternLayout</code> takes a logging event and returns a + <code>String</code>. However, this <code>String</code> can be + customized at will by tweaking the conversion pattern of + <code>PatternLayout</code>. </p> <p> The conversion pattern of @@ -360,9 +328,9 @@ static public void main(String[] args) throws Exception { Logger rootLogger = (Logger)LoggerFactory.getLogger("root"); - <b>PatternLayout layout = new PatternLayout(); - layout.setPattern("%-5level [%thread]: %message%n"); - layout.start();</b> + <b>PatternLayout layout = new PatternLayout();</b> + <b>layout.setPattern("%-5level [%thread]: %message%n");</b> + <b>layout.start();</b> ConsoleAppender<LoggingEvent> appender = new ConsoleAppender<LoggingEvent>(); appender.setContext(rootLogger.getLoggerContext()); @@ -395,29 +363,34 @@ justified to a width of five characters. Format specifiers will be explained in a short moment. </p> - <p> - Note that usual brackets chars <em>(</em> - and <em>)</em> need to be escaped to be parsed correctly. These - brackets can be used by adding two backslashes before the bracket - like in <em>\\)</em> and <em>\\)</em>. + + <p>In PatternLayout, parenthesis can be used to group conversion + patterns. It follows that the '(' and ')' carry special meaning + and need to be escaped to be used as literals. Parentheses can + be escaped by preceding the the opening and closing parenthesis + by backslash, but since backslash itself carries special meaning + in Java, we need two backslahes, as in "\\(" and "\\)". In + practice however, only the opening parenthesis needs to be + escaped to be used as a literal. </p> - <p> - As mentionned previously, certain conversion specifiers can include - optional parameters which are declared - between braces following the conversion word. A sample conversion - specifier with options could be <em>%logger{10}</em>. + + <p>As mentionned previously, certain conversion specifiers can + include optional parameters which are passed between braces + following the conversion word. A sample conversion specifier with + options could be <code>%logger{10}</code>. Here "logger" is the + conversion word, and 10 is the option. </p> <p>The recognized conversions words along with their options are - described below. When multiple conversion words are listed on the left - column, they should be considered as aliases. + described in the table below. When multiple conversion words are + listed on the left column, they should be considered as aliases. </p> - <table border="1" CELLPADDING="8"> + <table class="bodyTable" border="0" CELLPADDING="8"> <th>Conversion Word</th> <th>Effect</th> - <tr> + <tr class="b"> <td align="center"> <b>c</b>{<em>length</em>} <br /> <b>l</b>{<em>length</em>} <br /> @@ -427,48 +400,48 @@ <td> <p> - Used to output the name of the logger at the - source of the logging event. - </p> - <p> - The logger name conversion word can take an - integer as a first option. The - converter's abbreviation algorithm will shorten the logger name - without significant loss of meaning. + Used to output the name of the logger at the origin of the + logging event. </p> - <p>The next table should clarify the matter.</p> + <p> + This conversion word can take an integer as first and only + option. The converter's abbreviation algorithm will + shorten the logger name, usually without significant loss + of meaning. The next table provides examples of the + abbreviation algorithm in action. + </p> - <table BORDER="1" CELLPADDING="8"> - <tr> - <th>Conversion Pattern</th> + <table class="bodyTable" border="0" cellpadding="8"> + <tr class="a"> + <th>Conversion specifier</th> <th>Logger name</th> <th>Result</th> </tr> - <tr> + <tr class="a"> <td>%logger</td> <td>mainPackage.sub.sample.Bar</td> <td>mainPackage.sub.sample.Bar</td> </tr> - <tr> + <tr class="a"> <td>%logger{10}</td> <td>mainPackage.sub.sample.Bar</td> <td>m.s.s.Bar</td> </tr> - <tr> + <tr class="a"> <td>%logger{15}</td> <td>mainPackage.sub.sample.Bar</td> <td>m.s.sample.Bar</td> </tr> - <tr> + <tr class="a"> <td>%logger{16}</td> <td>mainPackage.sub.sample.Bar</td> <td>m.sub.sample.Bar</td> </tr> - <tr> + <tr class="a"> <td>%logger{26}</td> <td>mainPackage.sub.sample.Bar</td> <td>mainPackage.sub.sample.Bar</td> @@ -476,7 +449,7 @@ </table> </td> </tr> - <tr> + <tr class="a"> <td align="center"> <b>C</b>{<em>length</em>} <br /> <b>class</b>{<em>length</em>} <br /> @@ -489,12 +462,9 @@ </p> <p> Just like the <em>%logger</em> conversion word above, this - word can take an interger as it's first option - and use its abbreviation algorithm to - shorten the class name. - </p> - <p> - By default the class name is output in full. + word can take an interger as it's first option and use its + abbreviation algorithm to shorten the class name. By + default the class name is output in full. </p> <p> Generating the caller class information is not particularly fast. @@ -504,42 +474,46 @@ </td> </tr> - <tr> + <tr class="b"> <td align="center"> <b>d</b>{<em>pattern</em>} <br /> <b>date</b>{<em>pattern</em>} <br /> </td> <td> - <p>Used to output the date of the logging event. - The date conversion word may be followed by an option - enclosed between braces.</p> + <p>Used to output the date of the logging event. The date + conversion word may be followed by an option enclosed + between braces.</p> + <p>The option admits the same syntax as the time pattern string of the <code>java.text.SimpleDateFormat</code>.</p> + <p>A shortcut to the ISO8601 format is available by - specifying the String <em>"ISO8601"</em> in the braces. If no option is set, - the converter uses <em>"ISO8601"</em> as the default value.</p> - <p>Here are some sample option values. They assume - that the actual date is Friday 20th of October, 2006 and that - the author finished his meal a short while ago.</p> + specifying the String <em>"ISO8601"</em> in the braces. If + no option is set, the converter uses <em>"ISO8601"</em> as + the default value.</p> + + <p>Here are some sample option values. They assume that the + actual date is Friday 20th of October, 2006 and that the + author finished his meal a short while ago.</p> - <table BORDER="1" CELLPADDING="8"> - <tr> + <table class="bodyTable" CELLPADDING="8"> + <tr class="a"> <th>Conversion Pattern</th> <th>Result</th> </tr> - <tr> + <tr class="a"> <td>%date</td> <td>2006-10-20 14:46:49,812</td> </tr> - <tr> + <tr class="a"> <td>%date{ISO8601}</td> <td>2006-10-20 14:46:49,812</td> </tr> - <tr> + <tr class="a"> <td>%date{HH:mm:ss.SSS}</td> <td>14:46:49.812</td> </tr> - <tr> + <tr class="a"> <td>%date{dd MMM yyyy ;HH:mm:ss.SSS}</td> <td>20 oct. 2006;14:46:49.812 </td> </tr> @@ -547,25 +521,24 @@ </td> </tr> - <tr> + <tr class="a"> <td align="center"> <b>F / file</b> </td> <td> - <p> - Used to output the file name where the logging - request was issued. + <p> Used to output the file name of the Java source file + where the logging request was issued. </p> - <p> - Generating the file information is not particularly fast. - Thus, it's use should be avoided unless - execution speed is not an issue. + + <p>Generating the file information is not particularly fast. + Thus, it's use should be avoided unless execution speed is + not an issue. </p> </td> </tr> - <tr> + <tr class="b"> <td align="center"> <b>caller{depth}</b> <b>caller{depth, evaluator-1, ... evaluator-n}</b> @@ -591,29 +564,31 @@ </p> <p>For example, <b>%caller{2}</b> would display the following excerpt:</p> -<div class="source"><pre>0 [main] DEBUG - logging statement +<div class="source white_bg"><pre>0 [main] DEBUG - logging statement Caller+0 at mainPackage.sub.sample.Bar.sampleMethodName(Bar.java:22) Caller+1 at mainPackage.sub.sample.Bar.createLoggingRequest(Bar.java:17)</pre></div> <p>And <b>%caller{3}</b> would display this other excerpt:</p> -<div class="source"><pre>16 [main] DEBUG - logging statement +<div class="source white_bg">16 [main] DEBUG - logging statement Caller+0 at mainPackage.sub.sample.Bar.sampleMethodName(Bar.java:22) Caller+1 at mainPackage.sub.sample.Bar.createLoggingRequest(Bar.java:17) -Caller+2 at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre></div> +Caller+2 at mainPackage.ConfigTester.main(ConfigTester.java:38)</div> - <p> - This conversion word can also use evaluators to test logging events - against a given criteria before creating the output. For example, - using <b>%caller{3, CALLER_DISPLAY_EVAL}</b> will display three lines - of stacktrace, only if the evaluator called <em>CALLER_DISPLAY_EVAL</em> - returns a <b>positive</b> answer. + <p>This conversion word can also use evaluators to test + logging events against a given criteria before creating the + output. For example, using <b>%caller{3, + CALLER_DISPLAY_EVAL}</b> will display three lines of + stacktrace, only if the evaluator called + <em>CALLER_DISPLAY_EVAL</em> returns a <b>positive</b> + answer. </p> + <p>Evaluators are described further down this document. </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"> <b>L / line</b> </td> @@ -632,7 +607,7 @@ </tr> - <tr> + <tr class="b"> <td align="center"> <b>m / msg / message</b> </td> @@ -642,7 +617,7 @@ </td> </tr> - <tr> + <tr class="a"> <td align="center"> <b>M / method</b> </td> @@ -660,7 +635,7 @@ </td> </tr> - <tr> + <tr class="b"> <td align="center"> <b>n</b> </td> @@ -681,14 +656,14 @@ </tr> - <tr> + <tr class="a"> <td align="center"> <b>p / le / level</b> </td> <td>Used to output the level of the logging event.</td> </tr> - <tr> + <tr class="b"> <td align="center"> <b>r / relative</b> @@ -702,7 +677,7 @@ </tr> - <tr> + <tr class="a"> <td align="center"> <b>t / thread</b> </td> @@ -714,7 +689,7 @@ </tr> - <tr> + <tr class="b"> <td align="center"> <b>X</b>{<em>key</em>} <br /> <b>mdc</b>{<em>key</em>} <br /> @@ -752,7 +727,7 @@ </td> </tr> - <tr> + <tr class="a"> <td align="center"> <b>ex</b>{<em>length</em>} <br /> <b>throwable</b>{<em>length</em>} <br /> @@ -778,30 +753,30 @@ <p>Here are some examples:</p> <table BORDER="1" CELLPADDING="8"> - <tr> + <tr class="a"> <th>Conversion Pattern</th> <th>Result</th> </tr> - <tr> + <tr class="a"> <td>%ex</td> <td><pre>mainPackage.foo.bar.TestException: Houston we have a problem at mainPackage.foo.bar.TestThrower.fire(TestThrower.java:22) at mainPackage.foo.bar.TestThrower.readyToLaunch(TestThrower.java:17) at mainPackage.ExceptionLauncher.main(ExceptionLauncher.java:38)</pre></td> </tr> - <tr> + <tr class="a"> <td>%ex{short}</td> <td><pre>mainPackage.foo.bar.TestException: Houston we have a problem at mainPackage.foo.bar.TestThrower.fire(TestThrower.java:22)</pre></td> </tr> - <tr> + <tr class="a"> <td>%ex{full}</td> <td><pre>mainPackage.foo.bar.TestException: Houston we have a problem at mainPackage.foo.bar.TestThrower.fire(TestThrower.java:22) at mainPackage.foo.bar.TestThrower.readyToLaunch(TestThrower.java:17) at mainPackage.ExceptionLauncher.main(ExceptionLauncher.java:38)</pre></td> </tr> - <tr> + <tr class="a"> <td>%ex{2}</td> <td><pre>mainPackage.foo.bar.TestException: Houston we have a problem at mainPackage.foo.bar.TestThrower.fire(TestThrower.java:22) @@ -820,7 +795,7 @@ </td> </tr> - <tr> + <tr class="b"> <td align="center"> <b>marker</b> </td> @@ -839,7 +814,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"> <b>%</b> @@ -907,7 +882,7 @@ <th>Maximum width</th> <th>Comment</th> - <tr> + <tr class="a"> <td align="center">%20logger</td> <td align="center">false</td> <td align="center">20</td> @@ -917,7 +892,7 @@ than 20 characters long. </td> </tr> - <tr> + <tr class="a"> <td align="center">%-20logger</td> <td align="center">true</td> <td align="center">20</td> @@ -927,7 +902,7 @@ than 20 characters long. </td> </tr> - <tr> + <tr class="a"> <td align="center">%.30logger</td> <td align="center">NA</td> <td align="center">none</td> @@ -937,7 +912,7 @@ longer than 30 characters. </td> </tr> - <tr> + <tr class="a"> <td align="center">%20.30logger</td> <td align="center">false</td> <td align="center">20</td> @@ -949,7 +924,7 @@ beginning. </td> </tr> - <tr> + <tr class="a"> <td align="center">%-20.30logger</td> <td align="center">true</td> <td align="center">20</td> @@ -961,7 +936,7 @@ <em>beginning</em>. </td> </tr> - <tr> + <tr class="a"> <td align="center">%.-30logger</td> <td align="center">NA</td> <td align="center">none</td> @@ -980,22 +955,22 @@ <th>Format modifier</th> <th>Logger name</th> <th>Result</th> - <tr> + <tr class="a"> <td align="center">[%-20.20logger]</td> <td align="center">main.Name</td> <td align="center"><pre>[main.Name ]</pre></td> </tr> - <tr> + <tr class="a"> <td align="center">[%20.-20logger]</td> <td align="center">main.Name</td> <td align="center"><pre>[ main.Name]</pre></td> </tr> - <tr> + <tr class="a"> <td align="center">[%-10.10logger]</td> <td align="center">main.foo.foo.bar.Name</td> <td align="center"><pre>[o.bar.Name]</pre></td> </tr> - <tr> + <tr class="a"> <td align="center">[%10.-10logger]</td> <td align="center">main.foo.foo.bar.Name</td> <td align="center"><pre>[main.foo.f]</pre></td> @@ -1480,7 +1455,7 @@ <th align="center">Conversion Word</th> <th align="center">Effect</th> - <tr> + <tr class="a"> <td align="center"><b>a / remoteIP</b></td> <td> <p> @@ -1488,7 +1463,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>A / localIP</b></td> <td> <p> @@ -1496,7 +1471,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>b / B / byteSent</b></td> <td> <p> @@ -1504,7 +1479,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>h / clientHost</b></td> <td> <p> @@ -1512,7 +1487,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>H / protocol</b></td> <td> <p> @@ -1520,7 +1495,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>l</b></td> <td> <p> @@ -1530,7 +1505,7 @@ </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>reqParameter{paramName}</b></td> <td> <p> @@ -1542,7 +1517,7 @@ displays the corresponding parameter.</p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>i{header} / header{header}</b></td> <td> <p> @@ -1556,7 +1531,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>m / requestMethod</b></td> <td> <p> @@ -1564,7 +1539,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>r / requestURL</b></td> <td> <p> @@ -1572,7 +1547,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>s / statusCode</b></td> <td> <p> @@ -1580,7 +1555,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>t / date</b></td> <td> <p> @@ -1611,7 +1586,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>u / user</b></td> <td> <p> @@ -1619,7 +1594,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>U / requestURI</b></td> <td> <p> @@ -1627,7 +1602,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>v / server</b></td> <td> <p> @@ -1635,7 +1610,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>localPort</b></td> <td> <p> @@ -1643,7 +1618,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>reqAttribute{attributeName}</b></td> <td> <p> @@ -1655,7 +1630,7 @@ displays the corresponding attribute.</p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>reqCookie{cookie}</b></td> <td> <p> @@ -1666,7 +1641,7 @@ <p><b>%cookie{COOKIE_NAME}</b> displays corresponding cookie.</p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>responseHeader{header}</b></td> <td> <p> @@ -1677,7 +1652,7 @@ <p><b>%header{Referer}</b> displays the referer of the response.</p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>requestContent</b></td> <td> <p> @@ -1693,7 +1668,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>fullRequest</b></td> <td> <p> @@ -1702,7 +1677,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>responseContent</b></td> <td> <p> @@ -1718,7 +1693,7 @@ </p> </td> </tr> - <tr> + <tr class="a"> <td align="center"><b>fullResponse</b></td> <td> <p> Modified: logback/trunk/logback-site/src/site/pages/templates/right.js ============================================================================== --- logback/trunk/logback-site/src/site/pages/templates/right.js (original) +++ logback/trunk/logback-site/src/site/pages/templates/right.js Fri Mar 2 21:55:39 2007 @@ -1,4 +1,8 @@ document.write('<p class="menu_header">New and noteworthy</p>') document.write('<p class="menu"><a href="10reasons.ppt">10 reasons for migrating</a>') + +document.write('<p class="menu"><a href="http://javablog.smilehouse.com/blog/default/Java/2007/02/02/Writing-rotated-and-compressed-access-logs-with-logback">Writing rotated and compressed access logs</a>') + + document.write('</p>')
participants (1)
-
noreply.ceki@qos.ch