
Author: ceki Date: Fri Nov 10 21:43:16 2006 New Revision: 898 Modified: logback/trunk/logback-site/src/site/xdocTemplates/shortIntro.xml logback/trunk/logback-skin/src/main/resources/css/site.css Log: ongoing work on shortIntro.xml minor changes to css/site.css Modified: logback/trunk/logback-site/src/site/xdocTemplates/shortIntro.xml ============================================================================== --- logback/trunk/logback-site/src/site/xdocTemplates/shortIntro.xml (original) +++ logback/trunk/logback-site/src/site/xdocTemplates/shortIntro.xml Fri Nov 10 21:43:16 2006 @@ -266,8 +266,6 @@ statements. </p> - <!-- ========= CEKI: STOPPED HERE =================== --> - <p> Here is a list of the three required steps in order to enable logging in your application. @@ -275,19 +273,19 @@ <ol> - <li>Configure the logback environment. You can do it using - several sophisticated ways. The BasicConfigurator is the + <li>Configure the logback environment. You can do so in several + more or less sophisticated ways. The BasicConfigurator is the simplest but also least flexible. More on this later.</li> <li>In every class where you wish to perform logging, retrieve a - Logger instance by invoking the + <code>Logger</code> instance by invoking the <code>org.slf4j.LoggerFactory</code> class' - <code>getLogger()</code> method, passing the current class' name + <code>getLogger()</code> method, passing the current class name or the class itself as parameter.</li> <li>Use this logger instance by invoking its printing methods, - namely the debug(), info(), warn() and error() methods. This - will produce logging output on the configured appenders.</li> + namely the debug(), info(), warn() and error(). This will + produce logging output on the configured appenders.</li> </ol> @@ -302,8 +300,8 @@ </p> <p> The Logger class is part of the classic module. On the other - hand, Appenders and Layouts are part of the core - module. Interestingly enough, the core has no notion of loggers. + hand, Appenders and Layouts are part of the core module. For the + sake of genericity, logback-core has no notion of loggers. </p> <h3>Logger context</h3> @@ -313,8 +311,8 @@ certain log statements while allowing others to print unhindered. This capability assumes that the logging space, that is, the space of all possible logging statements, is categorized - according to some developer-chosen criteria. This categorization - is an inherent part of loggers. + according to some developer-chosen criteria. In logback, this + categorization is an inherent part of loggers. </p> <p> @@ -341,17 +339,21 @@ This naming scheme should be familiar to most developers. </p> <p> - The root logger resides at the top of the logger hierarchy. - It is exceptional in that it always exists. Like every - logger, it can be retrieved by its name, like this: + The root logger resides at the top of the logger hierarchy. It + is exceptional in that it is part of every hierarchy at its + inception. Like every logger, it can be retrieved by its name, + as follows: </p> - <div class="source"><pre>Logger rootLogger = LoggerFactory.getLogger(LoggerContext.<em>ROOT_NAME</em>);</pre></div> + <div class="source"><pre>Logger rootLogger = LoggerFactory.getLogger(<a href="apidocs/constant-values.html#ch.qos.logback.classic.LoggerContext.ROOT_NAME">LoggerContext.<em>ROOT_NAME</em></a>);</pre></div> <p> All other loggers are also retrieved with the class static - <code>LoggerFactory.getLogger</code> method. This method takes the name - of the desired logger as a parameter. Some of the basic - methods in the <code>Logger</code> interface are listed below. + <code>getLogger</code> method found in the <b>CHECK THE + URL</b><a + href="http://www.slf4j.org/javadocs/org/slf4j/Logger.html">org.slf4j.LoggerFactory</a> + class. This method takes the name of the desired logger as a + parameter. Some of the basic methods in the <code>Logger</code> + interface are listed below. </p> <div class="source"><pre>package org.slf4j; @@ -366,11 +368,11 @@ }</pre></div> <p> - Loggers may be assigned levels. The set of possible levels, - that is DEBUG, INFO, WARN and ERROR are defined in the - <em>ch.qos.logback.classic.Level</em> class. In logback, the level class cannot - be sub-classed, because a much better approach exist in the form - of Marker objects. + Loggers may be assigned levels. The set of possible levels, that + is DEBUG, INFO, WARN and ERROR are defined in the + <code>ch.qos.logback.classic.Level</code> class. Note that in + logback, the level class is final and cannot be derived as a + much more flexible approach exist in the form of Marker objects. </p> <p> @@ -382,24 +384,22 @@ <div class="definition"> <div class="deftitle">Level Inheritance</div> <p> - The inherited level for a given logger <em>L</em>, - is equal to the first non-null level in the logger context, starting at - <em>L</em> and proceeding upwards in the context towards the root logger. + The effective level for a given logger <em>L</em>, is equal to + the first non-null level in its hierarchy, starting at + <em>L</em> itself and proceeding upwards in the context + towards the root logger. </p> </div> + <p> - In a <code>Logger</code> object, the situation where no level was assigned - means that the <code>level</code> attribute of that logger is null. It is then - its <em>effective level</em> attribute that shows the inherited value. - </p> - <p> - To ensure that all loggers can eventually inherit a level, - the root logger always has an assigned level. By default, its level is DEBUG. + To ensure that all loggers can eventually inherit a level, the + root logger always has an assigned level. By default, this level + is DEBUG. </p> <p> - Below are four examples with various assigned level values - and the resulting inherited levels according to the level inheritance - rule. + Below are four examples with various assigned level values and + the resulting effective (inherited) levels according to the + level inheritance rule. </p> <em>Example 1</em> @@ -417,7 +417,7 @@ </th> <th> - Inherited + Effective <br /> level </th> @@ -465,7 +465,7 @@ </th> <th> - Inherited + Effective <br /> level </th> @@ -512,7 +512,7 @@ level </th> <th> - Inherited + Effective <br /> level </th> @@ -561,7 +561,7 @@ level </th> <th> - Inherited + Effective <br /> level </th> @@ -589,36 +589,35 @@ </tr> </table> - <p> - In example 4 above, the loggers <code>root</code> and <code>X</code> - and are assigned the levels <code>DEBUG</code> and - <code>INFO</code> respectively. The loggers <code>X.Y</code> and - <code>X.Y.Z</code> inherits their level value from their nearest - parent <code>X</code>, which has an assigned level. + <!-- ========= CEKI: STOPPED HERE =================== --> + + <p>In example 4 above, the loggers <code>root</code> and + <code>X</code> and are assigned the levels <code>DEBUG</code> and + <code>INFO</code> respectively. The loggers <code>X.Y</code> and + <code>X.Y.Z</code> inherit their level value from their nearest + parent <code>X</code>, which has an assigned level. </p> <h3>Printing methods</h3> - <p> - By definition, the printing method determines the level of a - logging request. For example, if <code>L</code> - is a logger instance, then the statement <code>L.info("..")</code> - is a logging request of level INFO. + + <p>By definition, the printing method determines the level of a + logging request. For example, if <code>L</code> is a logger + instance, then the statement <code>L.info("..")</code> is a + logging request of level INFO. </p> - <p> - A logging request is said to be <em>enabled</em> - if its level is higher than or equal to the level of its - logger. Otherwise, the request is said to be - <em>disabled</em>. A logger without an assigned level will inherit one from - the context. This rule is summarized below. + + <p>A logging request is said to be <em>enabled</em> if its level + is higher than or equal to the level of its logger. Otherwise, the + request is said to be <em>disabled</em>. A logger without an + assigned level will inherit one from the context. This rule is + summarized below. </p> + <div class="definition"> <div class="deftitle">Basic Selection Rule</div> - <p> - A log request of level <em>p</em> - in a logger with (either assigned or inherited, - whichever is appropriate) level <em>q</em>, is enabled if - <em>p >= q</em>. + <p>A log request of level <em>p</em> in a logger with an + effective level <em>q</em>, is enabled if <em>p >= q</em>. </p> </div> @@ -628,15 +627,16 @@ <code>DEBUG < INFO < WARN < ERROR</code>. </p> - <p> - In a more graphic way, here is how the selection rule works: in the following - table, the horizontal header shows the level of the logging request, while the - vertical header shows the level of the logger. + <p>In a more graphic way, here is how the selection rule works: in + the following table, the vertical header shows the the level of + the logging request, designated by <em>p</em>, while the + horizontal header shows effective level of the logger, designated + by <em>q</em>. </p> <table> <tr> - <td></td> + <th><span style="align:center"><em>p</em>/<em>q</em></span></th> <th>DEBUG</th> <th>INFO</th> <th>WARN</th> @@ -645,29 +645,29 @@ <tr> <th>DEBUG</th> <td><span class="greenBold">YES</span></td> - <td><span class="greenBold">YES</span></td> - <td><span class="greenBold">YES</span></td> - <td><span class="greenBold">YES</span></td> + <td><span class="redBold">NO</span></td> + <td><span class="redBold">NO</span></td> + <td><span class="redBold">NO</span></td> </tr> <tr> <th>INFO</th> - <td><span class="redBold">NO</span></td> - <td><span class="greenBold">YES</span></td> <td><span class="greenBold">YES</span></td> <td><span class="greenBold">YES</span></td> + <td><span class="redBold">NO</span></td> + <td><span class="redBold">NO</span></td> </tr> <tr> <th>WARN</th> - <td><span class="redBold">NO</span></td> - <td><span class="redBold">NO</span></td> <td><span class="greenBold">YES</span></td> <td><span class="greenBold">YES</span></td> + <td><span class="greenBold">YES</span></td> + <td><span class="redBold">NO</span></td> </tr> <tr> <th>ERROR</th> - <td><span class="redBold">NO</span></td> - <td><span class="redBold">NO</span></td> - <td><span class="redBold">NO</span></td> + <td><span class="greenBold">YES</span></td> + <td><span class="greenBold">YES</span></td> + <td><span class="greenBold">YES</span></td> <td><span class="greenBold">YES</span></td> </tr> </table> @@ -677,27 +677,27 @@ <div class="source"><pre>// get a logger instance named "com.foo", with an <span class="blue">INFO</span> level. Logger logger = LoggerFactory.getLogger("com.foo"); //set its Level to <span class="blue">INFO</span> -logger.setLevel(Level.INFO); +logger.setLevel(Level. <span class="blue">INFO</span>); Logger barlogger = LoggerFactory.getLogger("com.foo.Bar"); -// This request is enabled, because <span class="green">WARN</span> >= <span class="blue">INFO</span> -logger.<span class="green">warn</span>("Low fuel level."); +// This request is enabled, because <span class="green bold">WARN</span> >= <span class="blue">INFO</span> +logger.<span class="green bold">warn</span>("Low fuel level."); -// This request is disabled, because <span class="green">DEBUG</span> < <span class="blue">INFO</span>. -logger.<span class="green">debug</span>("Starting search for nearest gas station."); +// This request is disabled, because <span class="green bold">DEBUG</span> < <span class="blue">INFO</span>. +logger.<span class="green bold">debug</span>("Starting search for nearest gas station."); // The logger instance barlogger, named "com.foo.Bar", // will inherit its level from the logger named // "com.foo" Thus, the following request is enabled -// because <span class="green">INFO</span> >= <span class="blue">INFO</span>. -barlogger.<span class="green">info</span>("Located nearest gas station."); +// because <span class="green bold">INFO</span> >= <span class="blue">INFO</span>. +barlogger.<span class="green bold">info</span>("Located nearest gas station."); -// This request is disabled, because<span class="green">DEBUG</span> < <span class="blue">INFO</span>. -barlogger.<span class="green">debug</span>("Exiting gas station search");</pre></div> +// This request is disabled, because <span class="green bold">DEBUG</span> < <span class="blue">INFO</span>. +barlogger.<span class="green bold">debug</span>("Exiting gas station search");</pre></div> <h3>Retrieving Loggers</h3> <p> - Calling the <code>getLogger</code> + Calling the <code><a href="/apidocs/org/slf4j/LoggerFactory.html#getLogger(java.lang.String)">LoggerFactory.getLogger</a></code> method with the same name will always return a reference to the exact same logger object. </p> Modified: logback/trunk/logback-skin/src/main/resources/css/site.css ============================================================================== --- logback/trunk/logback-skin/src/main/resources/css/site.css (original) +++ logback/trunk/logback-skin/src/main/resources/css/site.css Fri Nov 10 21:43:16 2006 @@ -29,12 +29,13 @@ body,td,select,input,li { font-family: Verdana, Helvetica, Arial, sans-serif; - font-size: 13px; + /* font-size: 13px; */ } +/* it's a bad idea to use fixed font sized */ code { font-family: Courier, monospace; - font-size: 13px; + /* font-size: 13px; */ } a { @@ -80,7 +81,7 @@ h2 { padding: 2px 2px 1px 0px; border: 0px solid #999; - color: navy; + color: #333; /*background-color: #ddd;*/ /*background-color: rgb(144,223,144);*/ background-color: white; font-weight: 900; @@ -90,8 +91,7 @@ h3 { padding: 2px 2px 2px 0px; border: 0px solid #aaa; - /*color: #900;*/ - color: navy; + color: #333; /*background-color: #eee;*/ background-color: white; font-weight: normal; @@ -365,4 +365,26 @@ .option { border: 1px solid black; font-family: Arial, sans-serif; -} \ No newline at end of file +} + +.bold{ + font-weight: bold; +} + +.big { + font-size: 110%; +} + +.highlight { + width: 300px; + float: right; + display: inline; + font-weight: bolder; + border:1px solid #000; + background:#FFCC99; + padding-top: 0px; + padding-left: 1ex; + padding-right: 1ex; + margin-left: 3em; + margin-right: 3em; +}