[logback-dev] svn commit: r2427 - in logback/trunk: logback-classic/src/test/input/joran logback-classic/src/test/java/ch/qos/logback/classic/joran logback-classic/src/test/java/ch/qos/logback/classic/rolling logback-core/src/test/java/ch/qos/logback/core/joran logback-core/src/test/java/ch/qos/logback/core/joran/action logback-site/src/site/pages logback-site/src/site/pages/manual
noreply.ceki at qos.ch
noreply.ceki at qos.ch
Sun Aug 9 19:51:56 CEST 2009
Author: ceki
Date: Sun Aug 9 19:51:56 2009
New Revision: 2427
Added:
logback/trunk/logback-classic/src/test/input/joran/timestamp.xml
logback/trunk/logback-classic/src/test/input/joran/unique.xml
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java
Modified:
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/PackageTest.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java
logback/trunk/logback-site/src/site/pages/manual/appenders.html
logback/trunk/logback-site/src/site/pages/manual/configuration.html
logback/trunk/logback-site/src/site/pages/news.html
Log:
- document and test the <timestamp> action. This fixes LBCORE-91.
Added: logback/trunk/logback-classic/src/test/input/joran/timestamp.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/test/input/joran/timestamp.xml Sun Aug 9 19:51:56 2009
@@ -0,0 +1,4 @@
+<configuration>
+ <timestamp key="testTimestamp" datePattern="yyyy-MM"/>
+</configuration>
+
\ No newline at end of file
Added: logback/trunk/logback-classic/src/test/input/joran/unique.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/test/input/joran/unique.xml Sun Aug 9 19:51:56 2009
@@ -0,0 +1,15 @@
+<configuration>
+ <timestamp key="dayTimestamp" datePattern="yyyyMMdd'T'HHmmss" />
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <File>target/test-output/TS_${dayTimestamp}log.txt</File>
+ <Append>false</Append>
+ <layout>
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
+ </layout>
+ </appender>
+
+ <root level="debug">
+ <appender-ref ref="FILE" />
+ </root>
+</configuration>
Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java (original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java Sun Aug 9 19:51:56 2009
@@ -15,6 +15,8 @@
import java.io.File;
import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import org.junit.Test;
import org.slf4j.MDC;
@@ -46,7 +48,7 @@
}
@Test
- public void testSimpleList() throws JoranException {
+ public void simpleList() throws JoranException {
configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/simpleList.xml");
Logger logger = loggerContext.getLogger(this.getClass().getName());
@@ -61,7 +63,7 @@
}
@Test
- public void testLevel() throws JoranException {
+ public void level() throws JoranException {
configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/simpleLevel.xml");
ListAppender listAppender = (ListAppender) root.getAppender("LIST");
assertEquals(0, listAppender.list.size());
@@ -71,7 +73,7 @@
}
@Test
- public void testRootLoggerLevelSettingBySystemProperty()
+ public void rootLoggerLevelSettingBySystemProperty()
throws JoranException {
String propertyName = "logback.level";
@@ -88,7 +90,7 @@
}
@Test
- public void testLoggerLevelSettingBySystemProperty() throws JoranException {
+ public void loggerLevelSettingBySystemProperty() throws JoranException {
String propertyName = "logback.level";
System.setProperty(propertyName, "DEBUG");
@@ -104,7 +106,7 @@
}
@Test
- public void testStatusListener() throws JoranException {
+ public void statusListener() throws JoranException {
configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/statusListener.xml");
// StatusPrinter.print(loggerContext);
}
@@ -117,7 +119,7 @@
}
@Test
- public void testEval() throws JoranException {
+ public void eval() throws JoranException {
configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/callerData.xml");
String msg = "hello world";
@@ -136,7 +138,7 @@
}
@Test
- public void testTurboFilter() throws JoranException {
+ public void turboFilter() throws JoranException {
// Although this test uses turbo filters, it only checks
// that Joran can see the xml element and create
// and place the relevant object correctly.
@@ -269,4 +271,19 @@
assertTrue(checker.isErrorFree());
assertTrue(checker.containsMatch("Resetting and reconfiguring context"));
}
+
+ @Test
+ public void timestamp() throws JoranException, IOException, InterruptedException {
+
+ String configFileAsStr = TeztConstants.TEST_DIR_PREFIX
+ + "input/joran/timestamp.xml";
+ configure(configFileAsStr);
+
+ String r = loggerContext.getProperty("testTimestamp");
+ assertNotNull(r);
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+ String expected = sdf.format(new Date());
+ assertEquals("expected \""+expected+"\" but got "+r, expected, r);
+ }
+
}
Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/PackageTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/PackageTest.java (original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/PackageTest.java Sun Aug 9 19:51:56 2009
@@ -13,8 +13,7 @@
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
-
@RunWith(Suite.class)
- at SuiteClasses( { TimeBasedRollingWithConfigFileTest.class})
+ at SuiteClasses( { UniqueFileTest.class, TimeBasedRollingWithConfigFileTest.class })
public class PackageTest {
}
\ No newline at end of file
Added: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java Sun Aug 9 19:51:56 2009
@@ -0,0 +1,61 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework.
+ *
+ * Copyright (C) 2000-2009, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.classic.rolling;
+
+import static org.junit.Assert.assertTrue;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.junit.Test;
+
+import ch.qos.logback.classic.ClassicTestConstants;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.joran.JoranConfigurator;
+import ch.qos.logback.core.joran.spi.JoranException;
+import ch.qos.logback.core.rolling.ScaffoldingForRollingTests;
+import ch.qos.logback.core.status.StatusChecker;
+import ch.qos.logback.core.util.CoreTestConstants;
+
+/**
+ * Test that we can create time-stamped log files with the help of
+ * the <timestamp> element in configuration files.
+ *
+ * @author Ceki Gülcü
+ *
+ */
+public class UniqueFileTest {
+
+ LoggerContext lc = new LoggerContext();
+ Logger logger = lc.getLogger(this.getClass());
+
+
+ void loadConfig(String confifFile) throws JoranException {
+ JoranConfigurator jc = new JoranConfigurator();
+ jc.setContext(lc);
+ jc.doConfigure(confifFile);
+ }
+
+ @Test
+ public void basic() throws Exception {
+ loadConfig(ClassicTestConstants.JORAN_INPUT_PREFIX + "/unique.xml");
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd'T'HHmmss");
+ String timestamp = sdf.format(new Date());
+
+ StatusChecker sc = new StatusChecker(lc);
+ assertTrue(sc.isErrorFree());
+
+ Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
+ root.info("hello");
+
+ ScaffoldingForRollingTests.existenceCheck(CoreTestConstants.OUTPUT_DIR_PREFIX+"TS_"+timestamp+"log.txt");
+ }
+}
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java Sun Aug 9 19:51:56 2009
@@ -43,12 +43,12 @@
public void doTest(String filename) throws Exception {
// rule store is case insensitve
- rulesMap.put(new Pattern("x/INC"), new IncAction());
+ rulesMap.put(new Pattern("x/inc"), new IncAction());
- TrivialConfigurator gc = new TrivialConfigurator(rulesMap);
+ TrivialConfigurator trivialConfigurator = new TrivialConfigurator(rulesMap);
- gc.setContext(context);
- gc.doConfigure(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"
+ trivialConfigurator.setContext(context);
+ trivialConfigurator.doConfigure(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"
+ filename);
}
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java Sun Aug 9 19:51:56 2009
@@ -1,3 +1,12 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework.
+ *
+ * Copyright (C) 2000-2009, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
package ch.qos.logback.core.joran.action;
import static org.junit.Assert.assertEquals;
@@ -16,25 +25,29 @@
import ch.qos.logback.core.util.CoreTestConstants;
import ch.qos.logback.core.util.StatusPrinter;
+/**
+ * Test {@link PropertyAction}.
+ * @author Ceki Gülcü
+ */
public class PropertyActionTest {
Context context;
InterpretationContext ec;
- PropertyAction spAction;
+ PropertyAction propertyAction;
DummyAttributes atts = new DummyAttributes();
@Before
public void setUp() throws Exception {
context = new ContextBase();
ec = new InterpretationContext(context, null);
- spAction = new PropertyAction();
- spAction.setContext(context);
+ propertyAction = new PropertyAction();
+ propertyAction.setContext(context);
}
@After
public void tearDown() throws Exception {
context = null;
- spAction = null;
+ propertyAction = null;
atts = null;
}
@@ -42,7 +55,7 @@
public void nameValuePair() {
atts.setValue("name", "v1");
atts.setValue("value", "work");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals("work", ec.getProperty("v1"));
}
@@ -51,14 +64,14 @@
context.putProperty("w", "wor");
atts.setValue("name", "v1");
atts.setValue("value", "${w}k");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals("work", ec.getProperty("v1"));
}
@Test
public void noValue() {
atts.setValue("name", "v1");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals(1, context.getStatusManager().getCount());
assertTrue(checkError());
}
@@ -66,14 +79,14 @@
@Test
public void noName() {
atts.setValue("value", "v1");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals(1, context.getStatusManager().getCount());
assertTrue(checkError());
}
@Test
public void noAttributes() {
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals(1, context.getStatusManager().getCount());
assertTrue(checkError());
StatusPrinter.print(context);
@@ -83,7 +96,7 @@
public void testFileNotLoaded() {
atts.setValue("file", "toto");
atts.setValue("value", "work");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals(1, context.getStatusManager().getCount());
assertTrue(checkError());
}
@@ -92,7 +105,7 @@
public void testLoadFileWithPrerequisiteSubsitution() {
context.putProperty("STEM", CoreTestConstants.TEST_DIR_PREFIX + "input/joran");
atts.setValue("file", "${STEM}/propertyActionTest.properties");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals("tata", ec.getProperty("v1"));
assertEquals("toto", ec.getProperty("v2"));
}
@@ -100,7 +113,7 @@
@Test
public void testLoadFile() {
atts.setValue("file", CoreTestConstants.TEST_DIR_PREFIX + "input/joran/propertyActionTest.properties");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals("tata", ec.getProperty("v1"));
assertEquals("toto", ec.getProperty("v2"));
}
@@ -108,7 +121,7 @@
@Test
public void testLoadResource() {
atts.setValue("resource", "asResource/joran/propertyActionTest.properties");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals("tata", ec.getProperty("r1"));
assertEquals("toto", ec.getProperty("r2"));
}
@@ -117,7 +130,7 @@
public void testLoadResourceWithPrerequisiteSubsitution() {
context.putProperty("STEM", "asResource/joran");
atts.setValue("resource", "${STEM}/propertyActionTest.properties");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals("tata", ec.getProperty("r1"));
assertEquals("toto", ec.getProperty("r2"));
}
@@ -125,7 +138,7 @@
@Test
public void testLoadNotPossible() {
atts.setValue("file", "toto");
- spAction.begin(ec, null, atts);
+ propertyAction.begin(ec, null, atts);
assertEquals(1, context.getStatusManager().getCount());
assertTrue(checkFileErrors());
}
Modified: logback/trunk/logback-site/src/site/pages/manual/appenders.html
==============================================================================
--- logback/trunk/logback-site/src/site/pages/manual/appenders.html (original)
+++ logback/trunk/logback-site/src/site/pages/manual/appenders.html Sun Aug 9 19:51:56 2009
@@ -601,10 +601,57 @@
<p class="source">java chapter4.ConfigurationTester src/main/java/chapter4/conf/logback-fileAppender.xml</p>
-
<h3>
- <a name="RollingFileAppender"
- href="#RollingFileAppender">RollingFileAppender</a></h3>
+ <a name="uniquelyNamed" href="#uniquelyNamed">Uniquely named
+ files (by timestamp)</a>
+ </h3>
+
+ <p>During the application development phase or in the case of
+ short-lived applications, e.g. batch applications, it is desriable
+ to create a new log file at each new application launch. This is
+ fairly easy to do with the help of the <code><timestamp></code>
+ element. Here's an example.</p>
+
+
+ <em>Example 4.<span class="autoEx"/>: Uniquely named FileAppender configuration by timestamp (logback-examples/src/main/java/chapter4/conf/logback-timestamp.xml)</em>
+ <pre class="prettyprint source"><configuration>
+
+ <!-- Insert the current time formatted as "yyyyMMdd'T'HHmmss" under
+ the key "bySecond" into the logger context. This value will be
+ available to all subsequent configuration elements. -->
+ <b><timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/></b>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <!-- use the previously created timestamp to create a uniquely
+ named log file -->
+ <File><b>log-${bySecond}.txt</b></File>
+ <layout>
+ <Pattern>%logger{35} - %msg%n</Pattern>
+ </layout>
+ </appender>
+
+ <root level="debug">
+ <appender-ref ref="FILE" />
+ </root>
+</configuration></pre>
+
+
+ <p>The timestamp element takes two attributes <span
+ class="attr">key</span> and <span
+ class="attr">datePattern</span>. The <span class="attr">key</span>
+ attribute is the name of the key under which the timestamp will be
+ available to subsequent configuration elements <a
+ href="configuration.html#variableSubstitution">as a
+ variable</a>. The <span class="attr">datePattern</span> attribute
+ denoted the date pattern used to convert the current time (at which
+ the configuration file is parsed) into a string. The date pattern
+ should follow the conventions defined in <a
+ href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.
+ </p>
+
+ <h3>
+ <a name="RollingFileAppender" href="#RollingFileAppender">RollingFileAppender</a>
+ </h3>
<p><a
href="../xref/ch/qos/logback/core/rolling/RollingFileAppender.html"><code>RollingFileAppender</code></a>
Modified: logback/trunk/logback-site/src/site/pages/manual/configuration.html
==============================================================================
--- logback/trunk/logback-site/src/site/pages/manual/configuration.html (original)
+++ logback/trunk/logback-site/src/site/pages/manual/configuration.html Sun Aug 9 19:51:56 2009
@@ -111,7 +111,8 @@
</p>
- <p>Assuming the <em>logback-test.xml</em> file is placed under
+ <p>If you are using Maven and assuming the
+ <em>logback-test.xml</em> file is placed under
<em>src/test/resources</em> folder, Maven will ensure that it
won't be included in the artifact produced. Thus, you can use a
different configuration file, namely <em>logback-test.xml</em>
@@ -176,13 +177,16 @@
refer to the <a href="../setup.html">setup page</a> for further
details.
</p>
-
+
+
<p>Assuming the configuration files <em>logback-test.xml</em> or
- <em>logback.xml</em> could not be found, logback will default to a
- minimal configuration mentioned earlier. This configuration is
- hardwired to attaching a <code>ConsoleAppender</code> to the root
- logger. The output is formatted using a
+ <em>logback.xml</em> are not present, logback will default to
+ invoking <a
+ href="../xref/ch/qos/logback/classic/BasicConfigurator.html"><code>BasicConfigurator</code></a>
+ which will set up a minimal configuration. This minimal
+ configuration consists of a <code>ConsoleAppender</code> attached
+ to the root logger. The output is formatted using a
<code>PatternLayout</code> set to the pattern <em>%d{HH:mm:ss.SSS}
[%thread] %-5level %logger{36} - %msg%n</em>. Moreover, by default
the root logger is assigned to the <code>DEBUG</code> level.
@@ -192,22 +196,31 @@
should be similar to:
</p>
-<div class="source"><pre>16:06:09.031 [main] INFO chapter3.MyApp1 - Entering application.
+ <p class="source">16:06:09.031 [main] INFO chapter3.MyApp1 - Entering application.
16:06:09.046 [main] DEBUG chapter3.Foo - Did it again!
-16:06:09.046 [main] INFO chapter3.MyApp1 - Exiting application.</pre></div>
+16:06:09.046 [main] INFO chapter3.MyApp1 - Exiting application.</p>
- <p>The <code>MyApp1</code> application links to logback via
- calls <code>org.slf4j.LoggerFactory</code> and
+ <div class="highlight">
+ <p>
+ Except code that configures logback (if such code exists)
+ client code does not need to depend on logback. Applications
+ that use logback as their logging framework will have a
+ compile-time dependency on SLF4J but not logback.
+ </p>
+ </div>
+
+ <p>The <code>MyApp1</code> application links to logback via calls
+ <code>org.slf4j.LoggerFactory</code> and
<code>org.slf4j.Logger</code> classes, retrieve the loggers it
wishes to use, and chugs on. Note that the only dependence of the
<code>Foo</code> class on logback are through
<code>org.slf4j.LoggerFactory</code> and
<code>org.slf4j.Logger</code> imports. Except code that configures
logback (if such code exists) client code does not need to depend
- on logback. Given that SLF4J permits the use of any implementation
- under its abstraction layer, it is rather easy to migrate large
- bodies of code from one logging system to another.
+ on logback. Given that SLF4J permits the use of any logging
+ framework under its abstraction layer, it is rather easy to migrate
+ large bodies of code from one logging framework to another.
</p>
<h3>Automatic configuration with <em>logback-test.xml</em> or
@@ -242,15 +255,24 @@
directory accessible from the class path. Running the <em>MyApp1</em>
application should give identical results to its previous run.</p>
- <p>If and only if there are warnings or errors during the parsing
- of the configuration file, logback will automatically print status
- data on the console. In the absence of warnings or errors, if you
- still wish to inspect logback's internal status, then you can
- instruct logback to print status data by invoking the
- <code>print()</code> of the <code>StatusPrinter</code> class. The
- <em>MyApp2</em> application shown below is identical to
- <em>MyApp1</em> except the addition of two lines of code for
- printing internal status data.</p>
+ <h4>Automatic printing of status messages in case of warning or errors</h4>
+
+ <div class="highlight">
+ <p>If warning or errors occur during the parsing of the
+ configuration file, logback will automatically print its internal
+ status messages on the console.
+ </p>
+ </div>
+
+ <p>If warnings or errors occur during the parsing of the
+ configuration file, logback will automatically print status data on
+ the console. In the absence of warnings or errors, if you still
+ wish to inspect logback's internal status, then you can instruct
+ logback to print status data by invoking the <code>print()</code>
+ of the <code>StatusPrinter</code> class. The <em>MyApp2</em>
+ application shown below is identical to <em>MyApp1</em> except the
+ addition of two lines of code for printing internal status
+ data.</p>
<em>Example 3.<span class="autoEx"/>: Print logback's internal status information
<a
@@ -295,8 +317,8 @@
configuration file, as shown below. Please note that this <span
class="attr">debug</span> attribute relates only to the status
data. It does <em>not</em> affect logback's configuration
- otherwise, in particular with respect to logger levels. (Put
- differently, no, the root logger will <em>not</em> be set to
+ otherwise, in particular with respect to logger levels. (If you are
+ asking, no, the root logger will <em>not</em> be set to
<code>DEBUG</code>.)
</p>
@@ -357,6 +379,13 @@
<h3><a name="autoScan" href="#autoScan">Automatically reloading
configuration file upon modification</a></h3>
+ <div class="highlight">
+ <p>Logback-classic can scan for changes in its configuration file
+ and automatically reconfigure itself when the said configuration
+ file changes.
+ </p>
+ </div>
+
<p>If instructed to do so, logback-classic will scan for changes in
its configuration file and automatically reconfigure itself when
the said configuration file changes. In order to instruct
@@ -622,6 +651,34 @@
alt="basic Syntax" title="Basic configuration file structure"/>
</p>
+
+ <div class="highlight">
+ <p>If you are unsure which case to use for a given tag name, just
+ follow the camelCase convention which should usually be
+ corrrect.</p>
+ </div>
+
+ <p>As of logback version 0.9.17, tag names pertaining to explicit
+ rules are case insensitive. For example, both
+ <code><logger></code>, <code><Logger></code> and
+ <code><LOGGER></code> are valid configuration elements and will
+ be interpreted in the same way. Note that XML well-formedness rules
+ still apply, if you open a tag as <code><xyz></code> you must
+ close it as <code></xyz></code>, <code></XyZ></code> will not
+ work. As for <a href="onJoran.html#implicit">implicit rules</a>, tag
+ names are case sensitive except for the first letter. Thus,
+ <code><xyz></code> and <code><Xyz></code> are equivalent but
+ not <code><xYz></code>. Implicit rules usually follow the <a
+ href="http://en.wikipedia.org/wiki/CamelCase">camel case</a>
+ convention, common in the Java world. Since it is not trivially easy
+ tell when a tag is associated with an explicit action and when it is
+ associated with an implicit action, it is not trivial to say whether
+ an XML tag is totally case-insensitive or case-insensitive with
+ respect to the first letter. If you are unsure which case to use for
+ a given tag name, just follow the camelCase convention which should
+ usually be correct.
+ </p>
+
<h4>Configuring Loggers, or the <code><logger></code> element</h4>
<p>A logger is configured using the <code>logger</code> element. A
Modified: logback/trunk/logback-site/src/site/pages/news.html
==============================================================================
--- logback/trunk/logback-site/src/site/pages/news.html (original)
+++ logback/trunk/logback-site/src/site/pages/news.html Sun Aug 9 19:51:56 2009
@@ -38,6 +38,24 @@
reported by Roland Klein and independently by Didier Besset.
</p>
+ <p>In configuration files, all tags names associated with explicit
+ actions are now case-insensitive. This should diminish
+ case-related errors users may make when writing configuration
+ files. Tag names associated with implicit actions which are
+ closely linked to the actual Java class being configured, still
+ need to follow the camelCase convention. If you are unsure which
+ case to use for a given tag name, just follow the camelCase
+ convention for tag names which should be correct in most
+ cases. </p>
+
+ <p>It is now possible to create <a
+ href="manual/appenders.html#uniquelyNamed">uniquely named files by
+ timestamp</a>. Such files are appropriate for log files associated
+ with batch applications. This enhancement fulfills <a
+ href="http://jira.qos.ch/browse/LBCORE-91">LBCORE-91</a> as
+ requested by Rick Beton and Szel Zoltan.
+ </p>
+
<p>Append mode is now mandatory in
<code>RollingFileAppender</code>. This was already the default and
truncation mode is unreasonable in most cases. For example, in
@@ -50,10 +68,10 @@
reported by Valery Shorin.</p>
- <p>The TimeBasedTriggeringPolicy has been heavily refactored. It
- is now possible to trigger rolling by <a
- href="">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXtime as well as by
- size</a>, fixing <a
+ <p>The <code>TimeBasedTriggeringPolicy</code> has been heavily
+ refactored. It is now possible to trigger rolling simultaenously
+ by <a href="manual/appenders.html#SizeAndTimeBasedFNATP">time and
+ by size</a>, fixing <a
href="http://jira.qos.ch/browse/LBCORE-61">LBCORE-61</a>.
</p>
More information about the logback-dev
mailing list