[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.21-14-g263b38a
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Thu Jun 17 15:30:39 CEST 2010
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 263b38aad03194fc0ec2c1b91ca8c99c885d1404 (commit)
via 2d15361dfeeabfb8155ab94fab624e73c07d4ca1 (commit)
via 4d88ab7333f6869bafb81cad50235c0668120bf7 (commit)
via a4257048960bc721dc1c0be167e22e7f0466ea79 (commit)
via f18d4917d502f5d8703f83fc252928c4403cfd92 (commit)
from a052f15d09636698c96fcdb753da3270f5c01b11 (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=263b38aad03194fc0ec2c1b91ca8c99c885d1404
http://github.com/ceki/logback/commit/263b38aad03194fc0ec2c1b91ca8c99c885d1404
commit 263b38aad03194fc0ec2c1b91ca8c99c885d1404
Author: Ceki Gulcu <ceki at qos.ch>
Date: Thu Jun 17 11:31:55 2010 +0200
- Fixed LBCORE-158
- added parent injection support in gaffer
- updated news.html
diff --git a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy
index 471c148..0686228 100644
--- a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy
+++ b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy
@@ -61,14 +61,9 @@ class ComponentDelegate extends ContextAwareBase {
if (closure) {
ComponentDelegate subDelegate = new ComponentDelegate(subComponent)
- cascadeFields(subDelegate);
- for (String k: fieldsToCaccade) {
- //println "caccading ${k} with value ${this."${k}"}"
- //subDelegate.metaClass."${k}" = this."${k}"
- }
-
-
+ cascadeFields(subDelegate)
subDelegate.context = context
+ injectParent(subComponent)
closure.delegate = subDelegate
closure.resolveStrategy = Closure.DELEGATE_FIRST
closure()
@@ -89,6 +84,12 @@ class ComponentDelegate extends ContextAwareBase {
}
}
+ void injectParent(Object subComponent) {
+ if(subComponent.hasProperty("parent")) {
+ subComponent.parent = component;
+ }
+ }
+
void propertyMissing(String name, def value) {
NestingType nestingType = PropertyUtil.nestingType(component, name);
if (nestingType == NestingType.NA) {
diff --git a/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy b/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy
index 7cc9a35..b923433 100644
--- a/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy
+++ b/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy
@@ -17,6 +17,10 @@ import ch.qos.logback.core.encoder.LayoutWrappingEncoder
import ch.qos.logback.classic.PatternLayout
import ch.qos.logback.core.util.StatusPrinter
import ch.qos.logback.classic.net.SMTPAppender
+import ch.qos.logback.core.rolling.RollingFileAppender
+import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
+import ch.qos.logback.classic.encoder.PatternLayoutEncoder
+import ch.qos.logback.core.util.CoreTestConstants
/**
* @author Ceki Gücü
@@ -28,6 +32,8 @@ class ConfigurationDelegateTest {
StatusChecker statusChecker = new StatusChecker(context)
int diff = RandomUtil.getPositiveInt();
+ String randomOutputDir = CoreTestConstants.OUTPUT_DIR_PREFIX + diff + "/";
+
@Before
void setUp() {
context.name = "ConfigurationDelegateTest"
@@ -148,8 +154,8 @@ class ConfigurationDelegateTest {
@Test
void appenderWithEncoder() {
configurationDelegate.appender("C", ConsoleAppender) {
- encoder (LayoutWrappingEncoder) {
- layout (PatternLayout) {
+ encoder(LayoutWrappingEncoder) {
+ layout(PatternLayout) {
pattern = "%m%n"
}
}
@@ -160,29 +166,50 @@ class ConfigurationDelegateTest {
ConsoleAppender ca = back
assertNotNull(ca.encoder)
assertNotNull(ca.encoder.layout)
- PatternLayout layout = ca.encoder.layout
+ PatternLayout layout = ca.encoder.layout
assertEquals("%m%n", layout.pattern)
}
- @Test
+ @Test
void appenderSMTP() {
configurationDelegate.appender("SMTP", SMTPAppender) {
to = "a"
to = "b"
- layout (PatternLayout) {
- pattern = "%m%n"
+ layout(PatternLayout) {
+ pattern = "%m%n"
}
}
- StatusPrinter.print context
+ //StatusPrinter.print context
Appender back = configurationDelegate.appenderList.find {it.name = "SMTP"}
assertNotNull(back)
assertEquals("SMTP", back.name)
SMTPAppender sa = back
- PatternLayout layout = sa.layout
+ PatternLayout layout = sa.layout
assertEquals("%m%n", layout.pattern)
assertEquals(["a", "b"], sa.toList.sort());
+ }
+
+ // test parent injection
+
+ @Test
+ void appenderRolling() {
+
+ String logFile = randomOutputDir+"log.txt";
+ configurationDelegate.appender("ROLLING", RollingFileAppender) {
+ file = logFile
+ rollingPolicy(TimeBasedRollingPolicy) {
+ fileNamePattern = randomOutputDir+"log.%d{yyyy-MM}.log.zip"
+ }
+ encoder(PatternLayoutEncoder) {
+ pattern = '%msg%n'
+ }
+ }
+ // StatusPrinter.print context
+ RollingFileAppender back = configurationDelegate.appenderList.find {it.name = "ROLLING"}
+ assertNotNull(back)
+ assertEquals(logFile, back.rollingPolicy.getParentsRawFileProperty())
}
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
index 41ccfc2..9070aca 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
@@ -22,6 +22,7 @@ import java.io.OutputStream;
* @author Ceki Gülcü
* @author Tom SH Liu
* @author Ruediger Dohna
+ * @author David Roussel
*/
public enum ConsoleTarget {
diff --git a/logback-site/src/site/pages/faq.html b/logback-site/src/site/pages/faq.html
index 12f8427..78477d4 100644
--- a/logback-site/src/site/pages/faq.html
+++ b/logback-site/src/site/pages/faq.html
@@ -50,10 +50,10 @@
</li>
<li>
- <a href="#configFileLocation">Where should the configuration files,
- <em>logback-test.xml</em> or <em>logback.xml</em>, be located
- on the classpath?</a>
- </li>
+ <a href="#configFileLocation">Where should the configuration
+ files such as <em>logback.groovy</em>,
+ <em>logback-test.xml</em> or <em>logback.xml</em> be located
+ on the classpath?</a> </li>
<li>
<a href="#sharedConfiguration">Is it possible for multiple JEE
@@ -151,20 +151,25 @@
<!-- ========================================================= -->
<dt>
- <a name="configFileLocation" href="#configFileLocation">Where
- should the configuration files, <em>logback-test.xml</em> or
- <em>logback.xml</em>, be located on the classpath?</a>
- </dt>
+
+ <a name="configFileLocation"
+ href="#configFileLocation">Where should the configuration
+ files such as <em>logback.groovy</em>,
+ <em>logback-test.xml</em> or <em>logback.xml</em> be located
+ on the classpath?</a>
+ </dt>
+
<dd>
- <p>Configuration files such as <em>logback-test.xml</em> or
- <em>logback.xml</em> can be located <b>directly</b> under
- any folder declared in the class path. For example, if the
- class path reads "c:/java/jdk15/lib/rt.jar;c:/mylibs/" then
- the <em>logback.xml</em> file should be located directly
- under "c:/mylibs/", that is as
- "c:/mylibs/logback.xml". Placing it under a sub-folder of
- c:/mylibs/, say, c:/mylibs/other/, will not work.</p>
+ <p>Configuration files such as <em>logback.groovy</em>,
+ <em>logback-test.xml</em> or <em>logback.xml</em> can be
+ located <b>directly</b> under any folder declared in the
+ class path. For example, if the class path reads
+ "c:/java/jdk15/lib/rt.jar;c:/mylibs/" then the
+ <em>logback.xml</em> file should be located directly under
+ "c:/mylibs/", that is as "c:/mylibs/logback.xml". Placing it
+ under a sub-folder of c:/mylibs/, say, c:/mylibs/other/,
+ will not work.</p>
<p>For web-applications, configuration files can be placed
<b>directly</b> under <em>WEB-INF/classes/</em>.</p>
diff --git a/logback-site/src/site/pages/manual/configuration.html b/logback-site/src/site/pages/manual/configuration.html
index ccf5099..3fea8db 100644
--- a/logback-site/src/site/pages/manual/configuration.html
+++ b/logback-site/src/site/pages/manual/configuration.html
@@ -72,9 +72,10 @@
</p>
<p>Logback can be configured either programmatically or with a
- configuration script (expressed in XML format). By the way,
- existing log4j users can convert their <em>log4j.properties</em>
- files to <em>logback.xml</em> using our <a
+ configuration script expressed in XML or Groovy format. By the
+ way, existing log4j users can convert their
+ <em>log4j.properties</em> files to <em>logback.xml</em> using our
+ <a
href="http://logback.qos.ch/translator/">PropertiesTranslator</a>
web-application.
</p>
@@ -86,7 +87,14 @@
<ol>
<li>
<p>Logback tries to find a file called
- <em>logback-test.xml</em> <a
+ <em>logback.groovy</em> <a
+ href="../faq.html#configFileLocation">in the
+ classpath</a>.</p>
+ </li>
+
+ <li>
+ <p>If no such file is found, logback tries to find a file
+ called <em>logback-test.xml</em> <a
href="../faq.html#configFileLocation">in the
classpath</a>.</p>
</li>
@@ -106,9 +114,9 @@
</ol>
- <p>The third and last step is meant to provide a default (but very
- basic) logging functionality in the absence of a configuration
- file.
+ <p>The fourth and last step is meant to provide a default (but
+ very basic) logging functionality in the absence of a
+ configuration file.
</p>
diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html
index 0df0912..d9e4272 100644
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@ -26,6 +26,25 @@
the <a href="http://www.qos.ch/mailman/listinfo/announce">QOS.ch
announce</a> mailing list.</p>
+
+ <hr width="80%" align="center" />
+
+ <h3>June 2xth, 2010 - Release of version 0.9.22</h3>
+
+ <p>Logback now supports <a href="manual/groovy.html">configuration
+ files written in Groovy</a> which are more convenient than
+ configuration files written in XML. We have also developped a tool
+ to <a
+ href="http://logback.qos.ch/translator/asGroovy.html">automatically
+ migrate your logback.xml files to logback.groovy</a>.
+ </p>
+
+ <p>Fixed synchronization issue in <code>ConsoleAppender</code> as
+ reported in <a
+ href="http://jira.qos.ch/browse/LBCORE-158">LBCORE-158</a> by
+ David Roussel who also supplied a corrective patch.</p>
+
+
<hr width="80%" align="center" />
<h3>May 8th, 2010 - Release of version 0.9.21</h3>
diff --git a/logback-site/src/site/pages/reasonsToSwitch.html b/logback-site/src/site/pages/reasonsToSwitch.html
index b12bf23..454ca22 100644
--- a/logback-site/src/site/pages/reasonsToSwitch.html
+++ b/logback-site/src/site/pages/reasonsToSwitch.html
@@ -63,6 +63,29 @@
<p>Logback ships with over two hundred pages of constantly updated
documentation.</p>
+ <h3><a name="DSL" href="#DSL">Configuration files in XML or
+ Groovy</a></h3>
+
+ <p>The traditional way of configuring logback is via an XML
+ file. Most of the examples in the documentation use this XML
+ syntax. However, as of logback version 0.9.22, <a
+ href="manual/groovy.html">configuration files written in
+ Groovy</a> are also supported. Compared to XML, groovy style
+ configuration is more intuitive, consistent and have a much
+ shorter syntax.
+ </p>
+
+ <p>
+ There is also a <a
+ href="http://logback.qos.ch/translator/asGroovy.html">tool to
+ automatically migrate your logback.xml files to
+ logback.groovy</a>.
+ </p>
+
+ <p>We also plan to support configration files written in
+ Scala.</p>
+
+
<h3><a name="autoScan" href="#autoScan">Automatic reloading of
configuration files</a></h3>
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=2d15361dfeeabfb8155ab94fab624e73c07d4ca1
http://github.com/ceki/logback/commit/2d15361dfeeabfb8155ab94fab624e73c07d4ca1
commit 2d15361dfeeabfb8155ab94fab624e73c07d4ca1
Merge: a052f15 4d88ab7
Author: Ceki Gulcu <ceki at qos.ch>
Date: Thu Jun 17 10:20:52 2010 +0200
Merge branch 'lbcore_158'
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=4d88ab7333f6869bafb81cad50235c0668120bf7
http://github.com/ceki/logback/commit/4d88ab7333f6869bafb81cad50235c0668120bf7
commit 4d88ab7333f6869bafb81cad50235c0668120bf7
Merge: ee6dcb6 a425704
Author: Ceki Gulcu <ceki at qos.ch>
Date: Thu Jun 17 10:16:51 2010 +0200
Merge http://github.com/diroussel/logback into lbcore_158
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=a4257048960bc721dc1c0be167e22e7f0466ea79
http://github.com/ceki/logback/commit/a4257048960bc721dc1c0be167e22e7f0466ea79
commit a4257048960bc721dc1c0be167e22e7f0466ea79
Author: David Roussel <dave at dvae.net>
Date: Fri Jun 11 22:30:20 2010 +0100
LBCORE-158 - fix for interleaved output to System.out when logback is not the only one writing to System.out (typo fix)
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
index b38f5f4..41ccfc2 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
@@ -30,7 +30,8 @@ public enum ConsoleTarget {
public void write(int b) throws IOException {
System.out.write(b);
}
- @Override+ public void write(byte b[]) throws IOException {
+ @Override
+ public void write(byte b[]) throws IOException {
System.out.write(b);
}
@Override
@@ -86,4 +87,4 @@ public enum ConsoleTarget {
public OutputStream getStream() {
return stream;
}
-}
\ No newline at end of file
+}
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=f18d4917d502f5d8703f83fc252928c4403cfd92
http://github.com/ceki/logback/commit/f18d4917d502f5d8703f83fc252928c4403cfd92
commit f18d4917d502f5d8703f83fc252928c4403cfd92
Author: David Roussel <github at diroussel.xsmail.com>
Date: Fri Jun 11 13:59:54 2010 -0700
LBCORE-158 - fix for interleaved output to System.out when logback is not the only one writing to System.out
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
index ea9c30d..b38f5f4 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/ConsoleTarget.java
@@ -30,6 +30,13 @@ public enum ConsoleTarget {
public void write(int b) throws IOException {
System.out.write(b);
}
+ @Override+ public void write(byte b[]) throws IOException {
+ System.out.write(b);
+ }
+ @Override
+ public void write(byte b[], int off, int len) throws IOException {
+ System.out.write(b, off, len);
+ }
@Override
public void flush() throws IOException {
System.out.flush();
@@ -42,6 +49,14 @@ public enum ConsoleTarget {
System.err.write(b);
}
@Override
+ public void write(byte b[]) throws IOException {
+ System.err.write(b);
+ }
+ @Override
+ public void write(byte b[], int off, int len) throws IOException {
+ System.err.write(b, off, len);
+ }
+ @Override
public void flush() throws IOException {
System.err.flush();
}
-----------------------------------------------------------------------
Summary of changes:
.../classic/gaffer/ComponentDelegate.groovy | 15 ++++---
.../gaffer/ConfigurationDelegateTest.groovy | 43 ++++++++++++++++----
.../qos/logback/core/joran/spi/ConsoleTarget.java | 19 ++++++++-
logback-site/src/site/pages/faq.html | 37 ++++++++++-------
.../src/site/pages/manual/configuration.html | 22 +++++++---
logback-site/src/site/pages/news.html | 19 +++++++++
logback-site/src/site/pages/reasonsToSwitch.html | 23 ++++++++++
7 files changed, 139 insertions(+), 39 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list