This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Logback: the generic, reliable, fast and flexible logging framework.".
The branch, master has been updated via 72c5de7d8d3fa05a4d0cccf1270cb0407f5f193a (commit) from 98cee806e36f61f770cf1d4c23063c366ae10bee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=72c5de7d8d3fa05a4d0cccf1270cb0407f5f193a http://github.com/ceki/logback/commit/72c5de7d8d3fa05a4d0cccf1270cb0407f5f193a commit 72c5de7d8d3fa05a4d0cccf1270cb0407f5f193a Author: Ceki Gulcu <c...@qos.ch> Date: Thu Mar 25 19:22:34 2010 +0100 - fixed charset support in Joran - doc edits diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java index 250c601..8231027 100644 --- a/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java +++ b/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java @@ -44,8 +44,6 @@ public class LayoutInsteadOfEncoderTest { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) loggerContext.getLogger(Logger.ROOT_LOGGER_NAME); FileAppender<ILoggingEvent> fileAppender = (FileAppender<ILoggingEvent>) root.getAppender("LIOE"); assertTrue(fileAppender.isStarted()); - - LayoutWrappingEncoder<ILoggingEvent> lwe = (LayoutWrappingEncoder<ILoggingEvent>) fileAppender.getEncoder(); - + assertTrue(fileAppender.getEncoder() instanceof LayoutWrappingEncoder); } } diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java index 5b495f5..07fa46f 100644 --- a/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java +++ b/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java @@ -33,7 +33,9 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.classic.turbo.DebugUsersTurboFilter; import ch.qos.logback.classic.turbo.NOPTurboFilter; import ch.qos.logback.classic.turbo.TurboFilter; +import ch.qos.logback.core.ConsoleAppender; import ch.qos.logback.core.CoreConstants; +import ch.qos.logback.core.encoder.LayoutWrappingEncoder; import ch.qos.logback.core.joran.spi.JoranException; import ch.qos.logback.core.read.ListAppender; import ch.qos.logback.core.status.StatusChecker; @@ -290,4 +292,23 @@ public class JoranConfiguratorTest { assertEquals("expected \"" + expected + "\" but got " + r, expected, r); } + @Test + public void encoderCharset() throws JoranException, IOException, + InterruptedException { + + String configFileAsStr = ClassicTestConstants.JORAN_INPUT_PREFIX + + "encoderCharset.xml"; + configure(configFileAsStr); + + ConsoleAppender<ILoggingEvent> consoleAppender = (ConsoleAppender<ILoggingEvent>) root.getAppender("CONSOLE"); + assertNotNull(consoleAppender); + LayoutWrappingEncoder<ILoggingEvent> encoder = (LayoutWrappingEncoder<ILoggingEvent>) consoleAppender.getEncoder(); + + assertEquals("UTF-8", encoder.getCharset().displayName()); + + StatusChecker checker = new StatusChecker(loggerContext); + assertTrue(checker.isErrorFree()); + + } + } diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/util/PropertySetter.java b/logback-core/src/main/java/ch/qos/logback/core/joran/util/PropertySetter.java index 246a0cb..b245a7c 100644 --- a/logback-core/src/main/java/ch/qos/logback/core/joran/util/PropertySetter.java +++ b/logback-core/src/main/java/ch/qos/logback/core/joran/util/PropertySetter.java @@ -21,7 +21,6 @@ import java.beans.MethodDescriptor; import java.beans.PropertyDescriptor; import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import java.nio.charset.Charset; import ch.qos.logback.core.joran.spi.DefaultClass; import ch.qos.logback.core.joran.spi.DefaultNestedComponentRegistry; @@ -390,10 +389,6 @@ public class PropertySetter extends ContextAwareBase { return name.substring(0, 1).toUpperCase() + name.substring(1); } - boolean isOfTypeCharset(Class<?> parameterClas) { - return Charset.class.isAssignableFrom(parameterClas); - } - protected Method getMethod(String methodName) { if (methodDescriptors == null) { introspect(); diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/util/StringToObjectConverter.java b/logback-core/src/main/java/ch/qos/logback/core/joran/util/StringToObjectConverter.java index 8008f48..386bf21 100644 --- a/logback-core/src/main/java/ch/qos/logback/core/joran/util/StringToObjectConverter.java +++ b/logback-core/src/main/java/ch/qos/logback/core/joran/util/StringToObjectConverter.java @@ -40,6 +40,8 @@ public class StringToObjectConverter { return true; } else if (parameterClass.isEnum()) { return true; + } else if (isOfTypeCharset(parameterClass)) { + return true; } return false; } diff --git a/logback-site/src/site/pages/index.html b/logback-site/src/site/pages/index.html index 0cd8ee0..9e1b898 100644 --- a/logback-site/src/site/pages/index.html +++ b/logback-site/src/site/pages/index.html @@ -23,7 +23,7 @@ <p>Logback is intended as a successor to the popular log4j project, <a href="reasonsToSwitch.html">picking up where log4j - left off</a>. + leaves off</a>. </p> <p>Logback's basic architecture is sufficiently generic so as to @@ -66,6 +66,8 @@ <li><a href="http://www.jfrog.org/products.php">Artifactory</a></li> + <li><a href="http://cia.sourceforge.net/">Citizen Intelligence Agency</a></li> + <li><a href="http://www.geomajas.org/">Geomajas</a></li> <li><a href="http://jmxmonitor.sourceforge.net/">jmxmonitor</a></li> @@ -75,9 +77,12 @@ <li><a href="http://liftweb.net/">Lift</a></li> + <li><a href="http://www.red5.org">Red5</a></li> + <li><a href="http://sonar.codehaus.org/">Sonar</a> </li> + <li><a href="http://static.springsource.org/s2-dmserver/2.0.x/user-guide/htmlsingle/user-guide.html">SpringSource dm Server</a></li> diff --git a/logback-site/src/site/pages/manual/layouts.html b/logback-site/src/site/pages/manual/layouts.html index 99a2c74..9288854 100644 --- a/logback-site/src/site/pages/manual/layouts.html +++ b/logback-site/src/site/pages/manual/layouts.html @@ -895,7 +895,7 @@ Caller+2 at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre> followed by the "Implementation-Version" as found in that jar's manifest will be added. This innovative technique was <a - href="http://macstrac.blogspot.com/2008/09/better-stack-traces-in-java-with-log4j.html">suggested + href="http://macstrac.blogspot.com/2008/09/better-stack-traces-in-java-with-log4j.html">originally suggested by James Strachan</a>. If the information is uncertain, then the class packaging data will be preceded by a tilde, i.e. the '~' character. diff --git a/logback-site/src/site/pages/manual/loggingSeparation.html b/logback-site/src/site/pages/manual/loggingSeparation.html index d366182..78a2a9a 100644 --- a/logback-site/src/site/pages/manual/loggingSeparation.html +++ b/logback-site/src/site/pages/manual/loggingSeparation.html @@ -66,7 +66,8 @@ of the container itself. </p> - <h2>The simplest and easiest approach</h2> + <h2><a name="easy" href="#easy">The simplest and easiest + approach</a></h2> <p>Assuming your container supports child first class loading, separation of logging can be accomplished by embedding a copy of @@ -112,15 +113,16 @@ parent class loader. This implies that slf4j and logback jar files must also be accessible to the parent class loader. Note that for this scenario to occur a class must be shared - <em>and</em> use slf4j, which is somewhat uncommon. + <em>and</em> use slf4j. </p> <p>However, if the container itself uses SLF4J and defaults to - parent-first class loading, then you need context selectors. Read - on. + parent-first class loading, then you need context selectors in + order to acheive logging separation. Read on. </p> - <h2>Context Selectors</h2> + <h2><a name="contextSelectors" href="#contextSelectors">Context + Selectors</a></h2> <p>Logback provides a mechanism for a single instance of SLF4J and @@ -131,7 +133,7 @@ <pre class="prettyprint source">Logger logger = LoggerFactory.getLogger("foo");</pre> <p>the <code>getLogger</code>() method in - <code>LoggerFactory</code> class asks the SLF4J binding for a + <code>LoggerFactory</code> class will ask the SLF4J binding for a <code>ILoggerFactory</code>. When SLF4J is bound to logback, the task of returning an <code>ILoggerFactory</code> is delegated to an instance of <a @@ -164,14 +166,15 @@ </p> - <h3>ContextJNDISelector</h3> + <h3><a name="ContextJNDISelector" + href="#ContextJNDISelector">ContextJNDISelector</a></h3> <p>Logback-classic ships with a selector called <code>ContextJNDISelector</code> which selects the logger context - based on data available in JNDI. This leverages JNDI data - separation mandated by the J2EE specification. The same - environment variable can be set to carry a different value in each - application. + based on data available via JNDI lookup. This approach leverages + JNDI data separation mandated by the J2EE specification. Thus, the + same environment variable can be set to carry a different value in + different applications. </p> <p>To enable <code>ContextJNDISelector</code>, the @@ -181,9 +184,11 @@ <p class="source">-Dlogback.ContextSelector=JNDI</p> <p>Note that JNDI is a convenient shorthand for - "ch.qos.logback.classic.selector.ContextJNDISelector".</p> + <code>ch.qos.logback.classic.selector.ContextJNDISelector</code>.</p> - <h3>Setting JNDI variables in applications</h3> + <h3><a name="settingJNDIVariables" + href="#settingJNDIVariables">Setting JNDI variables in + applications</a></h3> <p>In each of your applications, you need to name the logging context for the application. For a web-application, JNDI @@ -221,12 +226,13 @@ </env-entry></pre> - <h3>Configuring Tomcat for ContextJNDISelector</h3> + <h3><a name="jndiTomcat" href="#jndiTomcat">Configuring Tomcat for + ContextJNDISelector</a></h3> <p>First, place the logback jars (that is logback-classic-${project.version}.jar, logback-core-${project.version}.jar and - slf4j-api-${slff4j.version}.jar) in Tomcat's global (shared) class + slf4j-api-${slf4j.version}.jar) in Tomcat's global (shared) class folder. In Tomcat 6.x, this directory is <em>$TOMCAT_HOME/lib/</em>. </p> @@ -239,24 +245,26 @@ <p class="source">JAVA_OPTS="$JAVA_OPTS -Dlogback.ContextSelector=JNDI"</p> - <h3>Hot deploying applications</h3> - + <h3><a name="hotDeploy" href="#hotDeploy">Hot deploying + applications</a></h3> <p>When the web-application is recycled or shutdown, we strongly - recommend that the older <code>LoggerContext</code> be closed and - subsequently discarded. Logback ships with a - <code>ServletContextListener</code> called - <code>ContextDetachingSCL</code>, designed specifically for - detaching the <code>ContextSelector</code> instance associated - with the older web-application instance. In order to install it, - add the following lines to your web-applications <em>web.xml</em> + recommend that the incumbent <code>LoggerContext</code> be closed + so that it can be properly gargabe collected. Logback ships with a + <code>ServletContextListener</code> called <a + href="../xref/ch/qos/logback/classic/selector/servlet/ContextDetachingSCL.html"><code>ContextDetachingSCL</code></a>, + designed specifically for detaching the + <code>ContextSelector</code> instance associated with the older + web-application instance. It can be installed by adding the + following lines into your web-applications <em>web.xml</em> file.</p> <pre class="prettyprint source"><listener> <listener-class>ch.qos.logback.classic.selector.servlet.ContextDetachingSCL</listener-class> </listener></pre> - <h3>Better performance</h3> + <h3><a name="betterPerf" href="betterPerf">Better + performance</a></h3> <p>When <code>ContextJNDISelector</code> is active, each time a logger is retrieved, a JNDI lookup must be performed. This can @@ -264,7 +272,7 @@ non-static (aka instance) logger references. Logback ships with a servlet filter named <a href="../xref/ch/qos/logback/classic/selector/servlet/LoggerContextFilter.html">LoggerContextFilter</a>, - specifically designed to circumvent the JNDI lookup cost. It can + specifically designed to avoid the JNDI lookup cost. It can be installed by adding the following lines to your applications web.xml file.</p> diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html index 8e02ed1..6945029 100644 --- a/logback-site/src/site/pages/news.html +++ b/logback-site/src/site/pages/news.html @@ -26,6 +26,19 @@ the <a href="http://www.qos.ch/mailman/listinfo/announce">QOS.ch announce</a> mailing list.</p> + + <hr width="80%" align="center" /> + + <h3>March , 2010 - Release of version 0.9.20</h3> + + <p>Fixed issue related to charsets in + <code>LayoutWrappingEncoder</code> not being recognized in config + files..</p> + + + + <!-- ============================================================== --> + <hr width="80%" align="center" /> <h3>March 24, 2010 - Release of version 0.9.19</h3> diff --git a/logback-site/src/site/pages/reasonsToSwitch.html b/logback-site/src/site/pages/reasonsToSwitch.html index f388cee..4889038 100644 --- a/logback-site/src/site/pages/reasonsToSwitch.html +++ b/logback-site/src/site/pages/reasonsToSwitch.html @@ -28,8 +28,8 @@ <h3><a name="fasterImpl" href="#fasterImpl">Faster implementation</a></h3> - <p>Based on our previous work done on log4j, logback internals - have been re-written to perform about ten times faster on certain + <p>Based on our previous work on log4j, logback internals have + been re-written to perform about ten times faster on certain critical execution paths. Not only are logback components faster, they have a smaller memory footprint as well.</p> @@ -81,7 +81,8 @@ chainsaw, except that Lilith is designed to handle large amounts of logging data without flinching.</p> - <h3><a name="grace" href="#grace">Prudent mode and graceful recovery</a></h3> + <h3><a name="grace" href="#grace">Prudent mode and graceful + recovery</a></h3> <p>In <a href="manual/appenders.html#prudent">prudent mode</a>, multiple <code>FileAppender</code> instances running on multiple @@ -93,7 +94,8 @@ <p>Logback's <code>FileAppender</code> and all its sub-classes, including <code>RollingFileAppender</code>, can gracefully recover from I/O failures. Thus, if a file server fails temporarily, you - no longer need to restart your application just to repair logging. + no longer need to restart your application just to get logging + working again. </p> @@ -183,10 +185,17 @@ java.lang.Exception: 99 is invalid stack trace, as a developper you will no longer need to ask them to send you information about the versions of packages they are using. The information will be part of the stack trace. See <a - href="manual/layouts.html#conversionWord">"%xThrowable" conversion + href="manual/layouts.html#xThrowable">"%xThrowable" conversion word</a> for details. </p> + <p>This feature can be quite helpful to the point that some users + mistakenly consider it a <a + href="http://www.jetbrains.net/devnet/message/5259058">feature of + their IDE</a>. + </p> + + <h3><a name="maxHistory" href="#maxHistory">Automatic erasure of old log archives</a></h3> @@ -203,11 +212,11 @@ java.lang.Exception: 99 is invalid </p> - <h3><a href="">In summary</a></h3> + <h3><a name="inSummary" href="#inSummary">In summary</a></h3> - <p>We have listed a small number of reasons for preferring logback - over log4j. Given that logback builds upon the log4j experience, - to put it simply, logback is just a better log4j.</p> + <p>We have listed a number of reasons for preferring logback over + log4j. Given that logback builds upon on our previous work on + log4j, simply put, logback is just a better log4j.</p> <script src="templates/footer.js" type="text/javascript"></script> </div> ----------------------------------------------------------------------- Summary of changes: .../encoder/LayoutInsteadOfEncoderTest.java | 4 +- .../classic/joran/JoranConfiguratorTest.java | 21 +++++++ .../logback/core/joran/util/PropertySetter.java | 5 -- .../core/joran/util/StringToObjectConverter.java | 2 + logback-site/src/site/pages/index.html | 7 ++- logback-site/src/site/pages/manual/layouts.html | 2 +- .../src/site/pages/manual/loggingSeparation.html | 60 +++++++++++--------- logback-site/src/site/pages/news.html | 13 ++++ logback-site/src/site/pages/reasonsToSwitch.html | 27 ++++++--- 9 files changed, 96 insertions(+), 45 deletions(-) hooks/post-receive -- Logback: the generic, reliable, fast and flexible logging framework. _______________________________________________ logback-dev mailing list logback-dev@qos.ch http://qos.ch/mailman/listinfo/logback-dev