logback-dev
Threads by month
- ----- 2025 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
June 2011
- 5 participants
- 81 discussions

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-8-gbca247d
by git-noreply@pixie.qos.ch 29 Jun '11
by git-noreply@pixie.qos.ch 29 Jun '11
29 Jun '11
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 bca247de428261b8c99c2a02cc4fc8ca580d78d2 (commit)
via 2b2edb0cc0d0e8c3f8c26a39e40811181aa4f632 (commit)
from 38d48fc3abfb16ca5a72668780ed5501ad3e422b (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=bca247de428261b8c99c2a02…
http://github.com/ceki/logback/commit/bca247de428261b8c99c2a02cc4fc8ca580d7…
commit bca247de428261b8c99c2a02cc4fc8ca580d78d2
Merge: 38d48fc 2b2edb0
Author: Ceki Gulcu <ceki(a)qos.ch>
Date: Wed Jun 29 12:12:36 2011 +0200
Merge commit '2b2edb0cc0d0e8c3f8c26a39e40811181aa4f63'
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=2b2edb0cc0d0e8c3f8c26a39…
http://github.com/ceki/logback/commit/2b2edb0cc0d0e8c3f8c26a39e40811181aa4f…
commit 2b2edb0cc0d0e8c3f8c26a39e40811181aa4f632
Author: Alexandre Garnier <zigarn(a)gmail.com>
Date: Tue Jun 28 22:56:24 2011 +0200
Allow multiple recipient address in 1 <to> element in SMTPAppender (LBCORE-213)
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
index 9e4e4ba..0f39071 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
@@ -233,5 +233,20 @@ public class SMTPAppender_GreenTest {
assertEquals(msg, body);
}
+ @Test
+ public void testMultipleTo() throws Exception {
+ buildSMTPAppender();
+ smtpAppender.setLayout(buildPatternLayout(lc));
+ smtpAppender.addTo("Test <test(a)example.com>, other-test(a)example.com");
+ smtpAppender.start();
+ logger.addAppender(smtpAppender);
+ logger.debug("hello");
+ logger.error("en error", new Exception("an exception"));
+
+ StatusPrinter.print(lc);
+ MimeMessage[] mma = greenMail.getReceivedMessages();
+ assertNotNull(mma);
+ assertEquals(3, mma.length);
+ }
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java
index 49cc3b4..13b9604 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java
@@ -307,6 +307,21 @@ public class SMTPAppender_SubethaSMTPTest {
StatusPrinter.print(lc);
}
+
+ @Test
+ public void testMultipleTo() throws Exception {
+ smtpAppender.setLayout(buildPatternLayout(lc));
+ smtpAppender.addTo("Test <test(a)example.com>, other-test(a)example.com");
+ smtpAppender.start();
+ Logger logger = lc.getLogger("test");
+ logger.addAppender(smtpAppender);
+ logger.debug("hello");
+ logger.error("en error", new Exception("an exception"));
+ List<WiserMessage> wiserMsgList = wiser.getMessages();
+
+ assertNotNull(wiserMsgList);
+ assertEquals(3, wiserMsgList.size());
+ }
public class TrivialAuthHandlerFactory implements AuthenticationHandlerFactory {
public AuthenticationHandler create() {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
index b692cd3..a0d72d0 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
@@ -14,6 +14,7 @@
package ch.qos.logback.core.net;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Properties;
@@ -266,8 +267,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
continue;
}
InternetAddress[] tmp = InternetAddress.parse(email, true);
- // one <To> element should contain one email address
- iaList.add(tmp[0]);
+ iaList.addAll(Arrays.asList(tmp));
} catch (AddressException e) {
addError("Could not parse email address for [" + toPatternLayoutList.get(i) + "] for event [" + event + "]", e);
return iaList;
-----------------------------------------------------------------------
Summary of changes:
.../classic/net/SMTPAppender_GreenTest.java | 15 +++++++++++++++
.../classic/net/SMTPAppender_SubethaSMTPTest.java | 15 +++++++++++++++
.../ch/qos/logback/core/net/SMTPAppenderBase.java | 4 ++--
3 files changed, 32 insertions(+), 2 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
1
0

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-6-g38d48fc
by git-noreply@pixie.qos.ch 24 Jun '11
by git-noreply@pixie.qos.ch 24 Jun '11
24 Jun '11
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 38d48fc3abfb16ca5a72668780ed5501ad3e422b (commit)
from 690ac09e30d017edea2681395b1fa33095f5f269 (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=38d48fc3abfb16ca5a726687…
http://github.com/ceki/logback/commit/38d48fc3abfb16ca5a72668780ed5501ad3e4…
commit 38d48fc3abfb16ca5a72668780ed5501ad3e422b
Author: Ceki Gulcu <ceki(a)qos.ch>
Date: Fri Jun 24 14:01:54 2011 +0200
configuration recovery works with included files as well. Fixes LBCLASSIC-265
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
index 6615f51..9ffa390 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
@@ -19,9 +19,11 @@ import java.util.List;
import ch.qos.logback.classic.gaffer.GafferUtil;
import ch.qos.logback.classic.util.EnvUtil;
+import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.joran.event.SaxEvent;
import ch.qos.logback.core.joran.spi.ConfigurationWatchList;
import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
+import ch.qos.logback.core.status.Status;
import ch.qos.logback.core.status.StatusChecker;
import ch.qos.logback.core.status.WarnStatus;
import org.slf4j.Marker;
@@ -175,34 +177,35 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
jc.setContext(context);
StatusChecker statusChecker = new StatusChecker(context);
List<SaxEvent> eventList = jc.recallSafeConfiguration();
- lc.getStatusManager().add(
- new InfoStatus("Resetting the logging ", this));
+ URL mainURL = ConfigurationWatchListUtil.getMainWatchURL(context);
lc.reset();
-
+ long threshold = System.currentTimeMillis();
try {
jc.doConfigure(mainConfigurationURL);
+ if (statusChecker.hasXMLParsingErrors(threshold)) {
+ fallbackConfiguration(lc, eventList, mainURL);
+ }
} catch (JoranException e) {
- fallbackConfiguration(lc, eventList);
+ fallbackConfiguration(lc, eventList, mainURL);
}
}
- private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList) {
- JoranConfigurator jc = new JoranConfigurator();
- jc.setContext(context);
+ private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList, URL mainURL) {
+ JoranConfigurator joranConfigurator = new JoranConfigurator();
+ joranConfigurator.setContext(context);
if (eventList != null) {
- lc.getStatusManager().add(
- new WarnStatus("Falling back to previously registered safe configuration.", this));
+ addWarn("Falling back to previously registered safe configuration.");
try {
- jc.doConfigure(eventList);
- addInfo("Re-registering previous fallback configuration as a fallback point");
- jc.registerSafeConfiguration();
+ lc.reset();
+ joranConfigurator.informContextOfURLUsedForConfiguration(context, mainURL);
+ joranConfigurator.doConfigure(eventList);
+ addInfo("Re-registering previous fallback configuration once more as a fallback configuration point");
+ joranConfigurator.registerSafeConfiguration();
} catch (JoranException e) {
- addError("Unexpected exception thrown by configuration considered as safes", e);
+ addError("Unexpected exception thrown by a configuration considered safe.", e);
}
} else {
- lc.getStatusManager().add(
- new WarnStatus("No previous configuration to fall back to.", this));
-
+ addWarn("No previous configuration to fall back to.");
}
}
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
index 6def1ae..6004966 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
@@ -44,13 +44,14 @@ import ch.qos.logback.core.status.InfoStatus;
import ch.qos.logback.core.status.StatusChecker;
import ch.qos.logback.core.testUtil.Env;
import ch.qos.logback.core.util.StatusPrinter;
+import sun.org.mozilla.javascript.internal.Context;
public class ReconfigureOnChangeTest {
final static int THREAD_COUNT = 5;
final static int LOOP_LEN = 1000 * 1000;
- static final boolean MUST_BE_ERROR_FREE = true;
- static final boolean ERRORS_EXPECTED = false;
+ static final boolean MUST_BE_ERROR_FREE = true;
+ static final boolean ERRORS_EXPECTED = false;
int diff = RandomUtil.getPositiveInt();
@@ -69,12 +70,18 @@ public class ReconfigureOnChangeTest {
final static String INCLUSION_SCAN_TOPLEVEL0_AS_STR = ClassicTestConstants.INPUT_PREFIX
+ "turbo/inclusion/topLevel0.xml";
+ final static String INCLUSION_SCAN_TOPLEVEL2_AS_STR = ClassicTestConstants.INPUT_PREFIX
+ + "turbo/inclusion/topLevel2.xml";
+
final static String INCLUSION_SCAN_TOP_BY_RESOURCE_AS_STR = ClassicTestConstants.INPUT_PREFIX
+ "turbo/inclusion/topByResource.xml";
final static String INCLUSION_SCAN_INNER0_AS_STR = ClassicTestConstants.INPUT_PREFIX
+ "turbo/inclusion/inner0.xml";
+ final static String INCLUSION_SCAN_INNER2_AS_STR = ClassicTestConstants.INPUT_PREFIX
+ + "turbo/inclusion/inner2.xml";
+
final static String INCLUSION_SCAN_INNER1_AS_STR = "target/test-classes/asResource/inner1.xml";
@@ -148,27 +155,32 @@ public class ReconfigureOnChangeTest {
new InfoStatus("end of execution ", this));
long expectedReconfigurations = runnableArray[0].getCounter();
- if(forcedReconfigurationSkip)
+ if (forcedReconfigurationSkip)
expectedReconfigurations = 0;
verify(expectedReconfigurations, mustBeErrorFree);
}
// chose a test at random. These tests are rather long...
- // check for deadlocks
+ // check for deadlocks
@Test(timeout = 20000)
- public void randomTest() throws JoranException, IOException, InterruptedException {
+ public void randomTest() throws JoranException, IOException, InterruptedException {
Random rand = new Random(System.currentTimeMillis());
- switch(rand.nextInt(5)) {
- case 0: scan1();
+ switch (rand.nextInt(5)) {
+ case 0:
+ scan1();
break;
- case 1: scanWithFileInclusion();
+ case 1:
+ scanWithFileInclusion();
break;
- case 2: scanWithResourceInclusion();
+ case 2:
+ scanWithResourceInclusion();
break;
- case 3: scan_lbclassic154();
+ case 3:
+ scan_lbclassic154();
break;
- case 4: gscan1();
+ case 4:
+ gscan1();
break;
}
}
@@ -208,13 +220,26 @@ public class ReconfigureOnChangeTest {
@Test
public void fallbackToSafe() throws IOException, JoranException, InterruptedException {
- String path = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig-"+diff + ".xml";
+ String path = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig_fallbackToSafe-" + diff + ".xml";
File file = new File(path);
writeToFile(file, "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><root level=\"ERROR\"/></configuration> ");
configure(file);
doScanTest(file, UpdateType.MALFORMED, false, ERRORS_EXPECTED);
}
+ @Test
+ public void fallbackToSafeWithIncludedFile() throws IOException, JoranException, InterruptedException {
+ String topLevelFileAsStr = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig_top-" + diff + ".xml";
+ String innerFileAsStr = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig_inner-" + diff + ".xml";
+ File topLevelFile = new File(topLevelFileAsStr);
+ writeToFile(topLevelFile, "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><include file=\""+innerFileAsStr+"\"/></configuration> ");
+
+ File innerFile = new File(innerFileAsStr);
+ writeToFile(innerFile, "<included><root level=\"ERROR\"/></included> ");
+ configure(topLevelFile);
+ doScanTest(innerFile, UpdateType.MALFORMED_INNER, false, ERRORS_EXPECTED);
+ }
+
@Test
public void gscan1() throws JoranException, IOException, InterruptedException {
@@ -248,12 +273,10 @@ public class ReconfigureOnChangeTest {
}
-
-
void verify(long expectedReconfigurations, boolean errorFreeness) {
StatusChecker checker = new StatusChecker(loggerContext);
StatusPrinter.print(loggerContext);
- if(errorFreeness == MUST_BE_ERROR_FREE) {
+ if (errorFreeness == MUST_BE_ERROR_FREE) {
assertTrue(checker.isErrorFree(0));
} else {
assertFalse(checker.isErrorFree(0));
@@ -262,9 +285,9 @@ public class ReconfigureOnChangeTest {
.matchCount("Will reset and reconfigure context");
// the number of effective resets must be equal or less than
// expectedReconfigurations
- System.out.println("effectiveResets="+effectiveResets);
+ System.out.println("effectiveResets=" + effectiveResets);
- System.out.println("expectedReconfigurations="+expectedReconfigurations);
+ System.out.println("expectedReconfigurations=" + expectedReconfigurations);
assertTrue(effectiveResets <= expectedReconfigurations);
// however, there should be some effective resets
@@ -351,7 +374,7 @@ public class ReconfigureOnChangeTest {
return (end - start) / (1.0d * LOOP_LEN);
}
- enum UpdateType {TOUCH, MALFORMED}
+ enum UpdateType {TOUCH, MALFORMED, MALFORMED_INNER}
void writeToFile(File file, String contents) {
try {
@@ -387,11 +410,15 @@ public class ReconfigureOnChangeTest {
}
counter++;
ReconfigureOnChangeTest.this.addInfo("***settting last modified", this);
- switch(updateType) {
- case TOUCH: updateFile();
+ switch (updateType) {
+ case TOUCH:
+ touchFile();
break;
case MALFORMED:
malformedUpdate(counter);
+ break;
+ case MALFORMED_INNER:
+ malformedInnerUpdate(counter);
}
}
}
@@ -401,11 +428,17 @@ public class ReconfigureOnChangeTest {
" <root level=\"ERROR\">\n" +
"</configuration>");
}
- void updateFile() {
+
+ private void malformedInnerUpdate(long counter) {
+ writeToFile(configFile, "<included>\n" +
+ " <root>\n" +
+ "</included>");
+ }
+
+ void touchFile() {
configFile.setLastModified(System.currentTimeMillis());
}
}
-
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
index ef1afb8..34b2c5d 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
@@ -115,6 +115,9 @@ public class CoreConstants {
static public final String CONFIGURATION_WATCH_LIST_RESET = "CONFIGURATION_WATCH_LIST_RESET";
static public final String SAFE_JORAN_CONFIGURATION = "SAFE_JORAN_CONFIGURATION";
+ static public final String XML_PARSING = "XML_PARSING";
+
+
/**
* The key under which the local host name is registered in the logger
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
index d52c529..75a2014 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
@@ -23,7 +23,9 @@ import java.util.List;
import static ch.qos.logback.core.CoreConstants.SAFE_JORAN_CONFIGURATION;
+import ch.qos.logback.core.Context;
import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
+import ch.qos.logback.core.status.StatusChecker;
import org.xml.sax.InputSource;
import ch.qos.logback.core.joran.event.SaxEvent;
@@ -44,7 +46,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
final public void doConfigure(URL url) throws JoranException {
try {
- informContextOfURLUsedForConfiguration(url);
+ informContextOfURLUsedForConfiguration(getContext(), url);
URLConnection urlConnection = url.openConnection();
// per http://jira.qos.ch/browse/LBCORE-105
// per http://jira.qos.ch/browse/LBCORE-127
@@ -67,7 +69,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
final public void doConfigure(File file) throws JoranException {
FileInputStream fis = null;
try {
- informContextOfURLUsedForConfiguration(file.toURI().toURL());
+ informContextOfURLUsedForConfiguration(getContext(), file.toURI().toURL());
fis = new FileInputStream(file);
doConfigure(fis);
} catch (IOException ioe) {
@@ -87,7 +89,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
}
}
- protected void informContextOfURLUsedForConfiguration(URL url) {
+ static public void informContextOfURLUsedForConfiguration(Context context, URL url) {
ConfigurationWatchListUtil.setMainWatchURL(context, url);
}
@@ -122,16 +124,20 @@ public abstract class GenericConfigurator extends ContextAwareBase {
final public void doConfigure(final InputSource inputSource)
throws JoranException {
+ long threshold = System.currentTimeMillis();
if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) {
- informContextOfURLUsedForConfiguration(null);
+ informContextOfURLUsedForConfiguration(getContext(), null);
}
SaxEventRecorder recorder = new SaxEventRecorder();
recorder.setContext(context);
recorder.recordEvents(inputSource);
doConfigure(recorder.saxEventList);
// no exceptions a this level
- addInfo("Registering current configuration as safe fallback point");
- registerSafeConfiguration();
+ StatusChecker statusChecker = new StatusChecker(context);
+ if(statusChecker.noXMLParsingErrorsOccurred(threshold)) {
+ addInfo("Registering current configuration as safe fallback point");
+ registerSafeConfiguration();
+ }
}
public void doConfigure(final List<SaxEvent> eventList)
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java b/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
index 286e2d2..275d981 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
@@ -59,17 +59,18 @@ public class IncludeAction extends Action {
try {
if (in != null) {
parseAndRecord(in, recorder);
+ // remove the <included> tag from the beginning and </included> from the end
+ trimHeadAndTail(recorder);
+
+ // offset = 2, because we need to get past this element as well as the end element
+ ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2);
}
} catch (JoranException e) {
addError("Error while parsing " + attributeInUse, e);
} finally {
close(in);
}
- // remove the <included> tag from the beginning and </included> from the end
- trimHeadAndTail(recorder);
- // offset = 2, because we need to get past this element as well as the end element
- ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2);
}
void close(InputStream in) {
@@ -197,7 +198,7 @@ public class IncludeAction extends Action {
InputStream getInputStream(InterpretationContext ec, Attributes attributes) {
URL inputURL = getInputURL(ec, attributes);
- if(inputURL == null)
+ if (inputURL == null)
return null;
ConfigurationWatchListUtil.addToWatchList(context, inputURL);
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
index 2e815e2..45bb694 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
@@ -21,7 +21,7 @@ import java.util.List;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import ch.qos.logback.core.CoreConstants;
+import static ch.qos.logback.core.CoreConstants.XML_PARSING;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
@@ -150,17 +150,17 @@ public class SaxEventRecorder extends DefaultHandler implements ContextAware {
}
public void error(SAXParseException spe) throws SAXException {
- addError("Parsing error on line " + spe.getLineNumber() + " and column "
+ addError(XML_PARSING +" - Parsing error on line " + spe.getLineNumber() + " and column "
+ spe.getColumnNumber(), spe);
}
public void fatalError(SAXParseException spe) throws SAXException {
- addError("Parsing fatal error on line " + spe.getLineNumber()
+ addError(XML_PARSING +" - Parsing fatal error on line " + spe.getLineNumber()
+ " and column " + spe.getColumnNumber(), spe);
}
public void warning(SAXParseException spe) throws SAXException {
- addWarn("Parsing warning on line " + spe.getLineNumber() + " and column "
+ addWarn(XML_PARSING +" - Parsing warning on line " + spe.getLineNumber() + " and column "
+ spe.getColumnNumber(), spe);
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
index 3197407..aa52afb 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
@@ -40,8 +40,8 @@ public class EventPlayer {
return new ArrayList<SaxEvent>(eventList);
}
- public void play(List<SaxEvent> seList) {
- eventList = seList;
+ public void play(List<SaxEvent> aSaxEventList) {
+ eventList = aSaxEventList;
SaxEvent se;
for(currentIndex = 0; currentIndex < eventList.size(); currentIndex++) {
se = eventList.get(currentIndex);
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java b/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java
index 6e61408..f2b0c53 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java
@@ -50,6 +50,15 @@ public class ConfigurationWatchListUtil {
cwl.setMainURL(url);
}
+ public static URL getMainWatchURL(Context context) {
+ ConfigurationWatchList cwl = getConfigurationWatchList(context);
+ if (cwl == null) {
+ return null;
+ } else {
+ return cwl.getMainURL();
+ }
+ }
+
public static void addToWatchList(Context context, URL url) {
ConfigurationWatchList cwl = getConfigurationWatchList(context);
if (cwl == null) {
@@ -62,12 +71,13 @@ public class ConfigurationWatchListUtil {
public static boolean wasConfigurationWatchListReset(Context context) {
Object o = context.getObject(CoreConstants.CONFIGURATION_WATCH_LIST_RESET);
- if(o == null)
+ if (o == null)
return false;
else {
return ((Boolean) o).booleanValue();
}
}
+
public static void setConfigurationWatchListResetFlag(Context context, boolean val) {
context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST_RESET, new Boolean(val));
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
index ff82f46..cf12305 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
@@ -43,6 +43,13 @@ public class StatusChecker {
return filteredList;
}
+ public boolean hasXMLParsingErrors(long threshold) {
+ return containsMatch(threshold, Status.ERROR, CoreConstants.XML_PARSING);
+ }
+ public boolean noXMLParsingErrorsOccurred(long threshold) {
+ return !hasXMLParsingErrors(threshold);
+ }
+
public int getHighestLevel(long threshold) {
List<Status> filteredList = filterStatusListByTimeThreshold(sm.getCopyOfStatusList(), threshold);
int maxLevel = Status.INFO;
@@ -57,10 +64,11 @@ public class StatusChecker {
return Status.ERROR > getHighestLevel(threshold);
}
- public boolean containsMatch(int level, String regex) {
+ public boolean containsMatch(long threshold, int level, String regex) {
+ List<Status> filteredList = filterStatusListByTimeThreshold(sm.getCopyOfStatusList(), threshold);
Pattern p = Pattern.compile(regex);
- for (Status status : sm.getCopyOfStatusList()) {
+ for (Status status : filteredList) {
if (level != status.getLevel()) {
continue;
}
@@ -74,6 +82,10 @@ public class StatusChecker {
}
+ public boolean containsMatch(int level, String regex) {
+ return containsMatch(0, level, regex);
+ }
+
public boolean containsMatch(String regex) {
Pattern p = Pattern.compile(regex);
for (Status status : sm.getCopyOfStatusList()) {
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
index 236e01a..3697c58 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
@@ -64,7 +64,7 @@ public class TrivialConfiguratorTest {
int oldBeginCount = IncAction.beginCount;
int oldEndCount = IncAction.endCount;
int oldErrorCount = IncAction.errorCount;
- doTest(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"+"inc.xml");
+ doTest(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/" + "inc.xml");
assertEquals(oldErrorCount, IncAction.errorCount);
assertEquals(oldBeginCount + 1, IncAction.beginCount);
assertEquals(oldEndCount + 1, IncAction.endCount);
@@ -85,7 +85,7 @@ public class TrivialConfiguratorTest {
tsl.list.size() >= 1);
Status s0 = tsl.list.get(0);
assertTrue(s0.getMessage().startsWith("Could not open ["));
- }
+ }
@Test
public void illFormedXML() {
@@ -98,8 +98,7 @@ public class TrivialConfiguratorTest {
}
assertEquals(1, tsl.list.size());
Status s0 = tsl.list.get(0);
- assertTrue(s0.getMessage().startsWith(
- "Parsing fatal error on line 5 and column 3"));
+ assertTrue(s0.getMessage().startsWith(CoreConstants.XML_PARSING));
}
@Test
-----------------------------------------------------------------------
Summary of changes:
.../classic/turbo/ReconfigureOnChangeFilter.java | 35 +++++----
.../classic/turbo/ReconfigureOnChangeTest.java | 77 ++++++++++++++------
.../java/ch/qos/logback/core/CoreConstants.java | 3 +
.../logback/core/joran/GenericConfigurator.java | 18 +++--
.../logback/core/joran/action/IncludeAction.java | 11 ++--
.../logback/core/joran/event/SaxEventRecorder.java | 8 +-
.../ch/qos/logback/core/joran/spi/EventPlayer.java | 4 +-
.../joran/util/ConfigurationWatchListUtil.java | 12 +++-
.../ch/qos/logback/core/status/StatusChecker.java | 16 ++++-
.../core/joran/TrivialConfiguratorTest.java | 7 +-
10 files changed, 129 insertions(+), 62 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
1
0
What is the significance of the teacup icon for logback (and log4j)?
1
0

[JIRA] Created: (LBCLASSIC-265) Logging stops if invalid xml configuration is loaded by scanner
by Iwein Fuld (JIRA) 23 Jun '11
by Iwein Fuld (JIRA) 23 Jun '11
23 Jun '11
Logging stops if invalid xml configuration is loaded by scanner
---------------------------------------------------------------
Key: LBCLASSIC-265
URL: http://jira.qos.ch/browse/LBCLASSIC-265
Project: logback-classic
Issue Type: Bug
Affects Versions: 0.9.28
Reporter: Iwein Fuld
Assignee: Logback dev list
When logging with scan="true" it is possible to stop all logging of an application silently.
Steps to reproduce:
- start an application with valid configuration and scan=true
- break the logback.xml (leave out a quote or something)
-> log goes silent
Expected behavior:
Logger fails to load new config and keeps running on the old configuration (like when valid xml, but invalid configuration is loaded).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
4
12

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-5-g690ac09
by git-noreply@pixie.qos.ch 23 Jun '11
by git-noreply@pixie.qos.ch 23 Jun '11
23 Jun '11
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 690ac09e30d017edea2681395b1fa33095f5f269 (commit)
from 33a24d81695f2a90ed239c0054225992c6be4aab (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=690ac09e30d017edea268139…
http://github.com/ceki/logback/commit/690ac09e30d017edea2681395b1fa33095f5f…
commit 690ac09e30d017edea2681395b1fa33095f5f269
Author: Ceki Gulcu <ceki(a)qos.ch>
Date: Thu Jun 23 23:40:38 2011 +0200
fixed LBCLASSIC-265
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
index c514c68..6615f51 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
@@ -19,8 +19,11 @@ import java.util.List;
import ch.qos.logback.classic.gaffer.GafferUtil;
import ch.qos.logback.classic.util.EnvUtil;
+import ch.qos.logback.core.joran.event.SaxEvent;
import ch.qos.logback.core.joran.spi.ConfigurationWatchList;
import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
+import ch.qos.logback.core.status.StatusChecker;
+import ch.qos.logback.core.status.WarnStatus;
import org.slf4j.Marker;
import ch.qos.logback.classic.Level;
@@ -51,26 +54,33 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
URL mainConfigurationURL;
protected volatile long nextCheck;
- ConfigurationWatchList cwl;
+ ConfigurationWatchList configurationWatchList;
@Override
public void start() {
- cwl = ConfigurationWatchListUtil.getConfigurationWatchList(context);
- if (cwl != null) {
- mainConfigurationURL = cwl.getMainURL();
- List<File> watchList = cwl.getCopyOfFileWatchList();
+ configurationWatchList = ConfigurationWatchListUtil.getConfigurationWatchList(context);
+ if (configurationWatchList != null) {
+ mainConfigurationURL = configurationWatchList.getMainURL();
+ List<File> watchList = configurationWatchList.getCopyOfFileWatchList();
long inSeconds = refreshPeriod / 1000;
addInfo("Will scan for changes in [" + watchList + "] every "
+ inSeconds + " seconds. ");
- synchronized (cwl) {
+ synchronized (configurationWatchList) {
updateNextCheck(System.currentTimeMillis());
}
super.start();
- } else {
+ } else {
addWarn("Empty ConfigurationWatchList in context");
}
}
+ @Override
+ public String toString() {
+ return "ReconfigureOnChangeFilter{" +
+ "invocationCounter=" + invocationCounter +
+ '}';
+ }
+
// The next fields counts the number of time the decide method is called
//
// IMPORTANT: This field can be updated by multiple threads. It follows that
@@ -91,7 +101,7 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
return FilterReply.NEUTRAL;
}
- synchronized (cwl) {
+ synchronized (configurationWatchList) {
if (changeDetected()) {
// Even though reconfiguration involves resetting the loggerContext,
// which clears the list of turbo filters including this instance, it is
@@ -109,7 +119,7 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
// locks held by the current thread, in particular, the AppenderAttachable
// reader lock.
private void detachReconfigurationToNewThread() {
- addInfo("Detected change in [" + cwl.getCopyOfFileWatchList() + "]");
+ addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]");
new ReconfiguringThread().start();
}
@@ -121,7 +131,7 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
long now = System.currentTimeMillis();
if (now >= nextCheck) {
updateNextCheck(now);
- return cwl.changeDetected();
+ return configurationWatchList.changeDetected();
}
return false;
}
@@ -140,23 +150,14 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
class ReconfiguringThread extends Thread {
public void run() {
- if(mainConfigurationURL == null) {
+ if (mainConfigurationURL == null) {
addInfo("Due to missing top level configuration file, skipping reconfiguration");
return;
}
LoggerContext lc = (LoggerContext) context;
addInfo("Will reset and reconfigure context named [" + context.getName() + "]");
if (mainConfigurationURL.toString().endsWith("xml")) {
- JoranConfigurator jc = new JoranConfigurator();
- jc.setContext(context);
- lc.reset();
- try {
- jc.doConfigure(mainConfigurationURL);
- lc.getStatusManager().add(
- new InfoStatus("done resetting the logging context", this));
- } catch (JoranException e) {
- addError("Failure during reconfiguration", e);
- }
+ performXMLConfiguration(lc);
} else if (mainConfigurationURL.toString().endsWith("groovy")) {
if (EnvUtil.isGroovyAvailable()) {
lc.reset();
@@ -168,5 +169,41 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
}
}
}
+
+ private void performXMLConfiguration(LoggerContext lc) {
+ JoranConfigurator jc = new JoranConfigurator();
+ jc.setContext(context);
+ StatusChecker statusChecker = new StatusChecker(context);
+ List<SaxEvent> eventList = jc.recallSafeConfiguration();
+ lc.getStatusManager().add(
+ new InfoStatus("Resetting the logging ", this));
+ lc.reset();
+
+ try {
+ jc.doConfigure(mainConfigurationURL);
+ } catch (JoranException e) {
+ fallbackConfiguration(lc, eventList);
+ }
+ }
+
+ private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList) {
+ JoranConfigurator jc = new JoranConfigurator();
+ jc.setContext(context);
+ if (eventList != null) {
+ lc.getStatusManager().add(
+ new WarnStatus("Falling back to previously registered safe configuration.", this));
+ try {
+ jc.doConfigure(eventList);
+ addInfo("Re-registering previous fallback configuration as a fallback point");
+ jc.registerSafeConfiguration();
+ } catch (JoranException e) {
+ addError("Unexpected exception thrown by configuration considered as safes", e);
+ }
+ } else {
+ lc.getStatusManager().add(
+ new WarnStatus("No previous configuration to fall back to.", this));
+
+ }
+ }
}
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
index 885e10f..6def1ae 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
@@ -14,6 +14,7 @@
package ch.qos.logback.classic.turbo;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.*;
@@ -22,7 +23,8 @@ import java.util.Random;
import ch.qos.logback.classic.gaffer.GafferConfigurator;
import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
-import org.hsqldb.lib.StringInputStream;
+import ch.qos.logback.core.testUtil.RandomUtil;
+import ch.qos.logback.core.util.CoreTestConstants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -47,6 +49,12 @@ public class ReconfigureOnChangeTest {
final static int THREAD_COUNT = 5;
final static int LOOP_LEN = 1000 * 1000;
+ static final boolean MUST_BE_ERROR_FREE = true;
+ static final boolean ERRORS_EXPECTED = false;
+
+
+ int diff = RandomUtil.getPositiveInt();
+
// the space in the file name mandated by
// http://jira.qos.ch/browse/LBCORE-119
final static String SCAN1_FILE_AS_STR = ClassicTestConstants.INPUT_PREFIX
@@ -118,9 +126,9 @@ public class ReconfigureOnChangeTest {
gc.run(file);
}
- RunnableWithCounterAndDone[] buildRunnableArray(File configFile) {
+ RunnableWithCounterAndDone[] buildRunnableArray(File configFile, UpdateType updateType) {
RunnableWithCounterAndDone[] rArray = new RunnableWithCounterAndDone[THREAD_COUNT];
- rArray[0] = new Updater(configFile);
+ rArray[0] = new Updater(configFile, updateType);
for (int i = 1; i < THREAD_COUNT; i++) {
rArray[i] = new LoggingRunnable(logger);
}
@@ -129,11 +137,11 @@ public class ReconfigureOnChangeTest {
void doScanTest(File fileToTouch) throws JoranException, IOException, InterruptedException {
- doScanTest(fileToTouch, false);
+ doScanTest(fileToTouch, UpdateType.TOUCH, false, MUST_BE_ERROR_FREE);
}
- void doScanTest(File fileToTouch, boolean forcedReconfigurationSkip) throws JoranException, IOException, InterruptedException {
- RunnableWithCounterAndDone[] runnableArray = buildRunnableArray(fileToTouch);
+ void doScanTest(File fileToTouch, UpdateType updateType, boolean forcedReconfigurationSkip, boolean mustBeErrorFree) throws JoranException, IOException, InterruptedException {
+ RunnableWithCounterAndDone[] runnableArray = buildRunnableArray(fileToTouch, updateType);
harness.execute(runnableArray);
loggerContext.getStatusManager().add(
@@ -143,7 +151,7 @@ public class ReconfigureOnChangeTest {
if(forcedReconfigurationSkip)
expectedReconfigurations = 0;
- verify(expectedReconfigurations);
+ verify(expectedReconfigurations, mustBeErrorFree);
}
// chose a test at random. These tests are rather long...
@@ -195,21 +203,31 @@ public class ReconfigureOnChangeTest {
String configurationStr = "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><include resource=\"asResource/inner1.xml\"/></configuration>";
configure(new ByteArrayInputStream(configurationStr.getBytes("UTF-8")));
File innerFile = new File(INCLUSION_SCAN_INNER1_AS_STR);
- doScanTest(innerFile, true);
+ doScanTest(innerFile, UpdateType.TOUCH, true, MUST_BE_ERROR_FREE);
+ }
+
+ @Test
+ public void fallbackToSafe() throws IOException, JoranException, InterruptedException {
+ String path = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig-"+diff + ".xml";
+ File file = new File(path);
+ writeToFile(file, "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><root level=\"ERROR\"/></configuration> ");
+ configure(file);
+ doScanTest(file, UpdateType.MALFORMED, false, ERRORS_EXPECTED);
}
+
@Test
public void gscan1() throws JoranException, IOException, InterruptedException {
File file = new File(G_SCAN1_FILE_AS_STR);
gConfigure(file);
- RunnableWithCounterAndDone[] runnableArray = buildRunnableArray(file);
+ RunnableWithCounterAndDone[] runnableArray = buildRunnableArray(file, UpdateType.TOUCH);
harness.execute(runnableArray);
loggerContext.getStatusManager().add(
new InfoStatus("end of execution ", this));
long expectedRreconfigurations = runnableArray[0].getCounter();
- verify(expectedRreconfigurations);
+ verify(expectedRreconfigurations, MUST_BE_ERROR_FREE);
}
// check for deadlocks
@@ -219,23 +237,27 @@ public class ReconfigureOnChangeTest {
InterruptedException {
File file = new File(SCAN_LBCLASSIC_154_FILE_AS_STR);
configure(file);
- RunnableWithCounterAndDone[] runnableArray = buildRunnableArray(file);
+ RunnableWithCounterAndDone[] runnableArray = buildRunnableArray(file, UpdateType.TOUCH);
harness.execute(runnableArray);
loggerContext.getStatusManager().add(
new InfoStatus("end of execution ", this));
long expectedReconfigurations = runnableArray[0].getCounter();
- verify(expectedReconfigurations);
+ verify(expectedReconfigurations, MUST_BE_ERROR_FREE);
}
- void verify(long expectedReconfigurations) {
+ void verify(long expectedReconfigurations, boolean errorFreeness) {
StatusChecker checker = new StatusChecker(loggerContext);
StatusPrinter.print(loggerContext);
- assertTrue(checker.isErrorFree(0));
+ if(errorFreeness == MUST_BE_ERROR_FREE) {
+ assertTrue(checker.isErrorFree(0));
+ } else {
+ assertFalse(checker.isErrorFree(0));
+ }
int effectiveResets = checker
.matchCount("Will reset and reconfigure context");
// the number of effective resets must be equal or less than
@@ -329,11 +351,29 @@ public class ReconfigureOnChangeTest {
return (end - start) / (1.0d * LOOP_LEN);
}
+ enum UpdateType {TOUCH, MALFORMED}
+
+ void writeToFile(File file, String contents) {
+ try {
+ FileWriter fw = new FileWriter(file);
+ fw.write(contents);
+ fw.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
class Updater extends RunnableWithCounterAndDone {
File configFile;
+ UpdateType updateType;
- Updater(File configFile) {
+ Updater(File configFile, UpdateType updateType) {
this.configFile = configFile;
+ this.updateType = updateType;
+ }
+
+ Updater(File configFile) {
+ this(configFile, UpdateType.TOUCH);
}
public void run() {
@@ -347,9 +387,25 @@ public class ReconfigureOnChangeTest {
}
counter++;
ReconfigureOnChangeTest.this.addInfo("***settting last modified", this);
- configFile.setLastModified(System.currentTimeMillis());
+ switch(updateType) {
+ case TOUCH: updateFile();
+ break;
+ case MALFORMED:
+ malformedUpdate(counter);
+ }
}
}
+
+ private void malformedUpdate(long counter) {
+ writeToFile(configFile, "<configuration scan=\"true\" scanPeriod=\"50 millisecond\">\n" +
+ " <root level=\"ERROR\">\n" +
+ "</configuration>");
+ }
+ void updateFile() {
+ configFile.setLastModified(System.currentTimeMillis());
+ }
}
+
+
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
index 3c624fa..ef1afb8 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
@@ -62,12 +62,12 @@ public class CoreConstants {
/**
* An empty string array.
*/
- public final static String[] EMPTY_STRING_ARRAY = new String[] {};
+ public final static String[] EMPTY_STRING_ARRAY = new String[]{};
/**
* An empty Class array.
*/
- public final static Class<?>[] EMPTY_CLASS_ARRAY = new Class[] {};
+ public final static Class<?>[] EMPTY_CLASS_ARRAY = new Class[]{};
public final static String CAUSED_BY = "Caused by: ";
@@ -111,9 +111,10 @@ public class CoreConstants {
static public final String SEE_FNP_NOT_SET = "See also http://logback.qos.ch/codes.html#tbr_fnp_not_set";
- public static String CONFIGURATION_WATCH_LIST = "CONFIGURATION_WATCH_LIST";
- public static String CONFIGURATION_WATCH_LIST_RESET = "CONFIGURATION_WATCH_LIST_RESET";
+ static public final String CONFIGURATION_WATCH_LIST = "CONFIGURATION_WATCH_LIST";
+ static public final String CONFIGURATION_WATCH_LIST_RESET = "CONFIGURATION_WATCH_LIST_RESET";
+ static public final String SAFE_JORAN_CONFIGURATION = "SAFE_JORAN_CONFIGURATION";
/**
* The key under which the local host name is registered in the logger
@@ -123,12 +124,11 @@ public class CoreConstants {
/**
* The key under which the current context name is registered in the logger
- * context.
+ * context.
*/
public static final String CONTEXT_NAME_KEY = "CONTEXT_NAME";
public static int BYTES_PER_INT = 4;
public static final int MILLIS_IN_ONE_SECOND = 1000;
- public final static String XML_PARSING_ERROR = "XML PARSING ERROR";
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
index 9b6ac3a..d52c529 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
@@ -21,6 +21,8 @@ import java.net.URL;
import java.net.URLConnection;
import java.util.List;
+import static ch.qos.logback.core.CoreConstants.SAFE_JORAN_CONFIGURATION;
+
import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
import org.xml.sax.InputSource;
@@ -47,7 +49,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
// per http://jira.qos.ch/browse/LBCORE-105
// per http://jira.qos.ch/browse/LBCORE-127
urlConnection.setUseCaches(false);
-
+
InputStream in = urlConnection.getInputStream();
doConfigure(in);
in.close();
@@ -69,7 +71,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
fis = new FileInputStream(file);
doConfigure(fis);
} catch (IOException ioe) {
- String errMsg = "Could not open [" + file.getName() + "].";
+ String errMsg = "Could not open [" + file.getPath() + "].";
addError(errMsg, ioe);
throw new JoranException(errMsg, ioe);
} finally {
@@ -98,13 +100,13 @@ public abstract class GenericConfigurator extends ContextAwareBase {
abstract protected void addImplicitRules(Interpreter interpreter);
protected void addDefaultNestedComponentRegistryRules(DefaultNestedComponentRegistry registry) {
-
+
}
-
+
protected Pattern initialPattern() {
return new Pattern();
}
-
+
protected void buildInterpreter() {
RuleStore rs = new SimpleRuleStore(context);
addInstanceRules(rs);
@@ -118,27 +120,43 @@ public abstract class GenericConfigurator extends ContextAwareBase {
// this is the most inner form of doConfigure whereto other doConfigure
// methods ultimately delegate
final public void doConfigure(final InputSource inputSource)
- throws JoranException {
+ throws JoranException {
- if(!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) {
+ if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) {
informContextOfURLUsedForConfiguration(null);
}
SaxEventRecorder recorder = new SaxEventRecorder();
recorder.setContext(context);
recorder.recordEvents(inputSource);
+ doConfigure(recorder.saxEventList);
+ // no exceptions a this level
+ addInfo("Registering current configuration as safe fallback point");
+ registerSafeConfiguration();
+ }
+
+ public void doConfigure(final List<SaxEvent> eventList)
+ throws JoranException {
buildInterpreter();
// disallow simultaneous configurations of the same context
synchronized (context.getConfigurationLock()) {
- interpreter.play(recorder.saxEventList);
+ interpreter.getEventPlayer().play(eventList);
}
+ }
+ /**
+ * Register the current event list in currently in the interpreter as a safe
+ * configuration point.
+ *
+ * @since 0.9.30
+ */
+ public void registerSafeConfiguration() {
+ context.putObject(SAFE_JORAN_CONFIGURATION, interpreter.getEventPlayer().getCopyOfPlayerEventList());
}
- // protected since v0.9.30
- protected void doConfigure(final List<SaxEvent> eventList)
- throws JoranException {
- buildInterpreter();
- EventPlayer player = new EventPlayer(interpreter);
- player.play(eventList);
+ /**
+ * Recall the event list previously registered as a safe point.
+ */
+ public List<SaxEvent> recallSafeConfiguration() {
+ return (List<SaxEvent>) context.getObject(SAFE_JORAN_CONFIGURATION);
}
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java b/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
index e29178d..286e2d2 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
@@ -69,7 +69,7 @@ public class IncludeAction extends Action {
trimHeadAndTail(recorder);
// offset = 2, because we need to get past this element as well as the end element
- ec.getJoranInterpreter().addEventsDynamically(recorder.saxEventList, 2);
+ ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2);
}
void close(InputStream in) {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/conditional/IfAction.java b/logback-core/src/main/java/ch/qos/logback/core/joran/conditional/IfAction.java
index e0e5f8b..97f9c80 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/conditional/IfAction.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/conditional/IfAction.java
@@ -112,7 +112,7 @@ public class IfAction extends Action {
// if boolResult==false & missing else, listToPlay may be null
if(listToPlay != null) {
// insert past this event
- interpreter.addEventsDynamically(listToPlay, 1);
+ interpreter.getEventPlayer().addEventsDynamically(listToPlay, 1);
}
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
index 5efbcd0..2e815e2 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
@@ -59,11 +59,12 @@ public class SaxEventRecorder extends DefaultHandler implements ContextAware {
saxParser.parse(inputSource, this);
return saxEventList;
} catch (IOException ie) {
- handleError(CoreConstants.XML_PARSING_ERROR+ ". I/O error occurred while parsing xml file", ie);
+ handleError("I/O error occurred while parsing xml file", ie);
} catch(SAXException se) {
- handleError(CoreConstants.XML_PARSING_ERROR+ ". Problem parsing XML document. See previously reported errors.", se);
+ // Exception added into StatusManager via Sax error handling. No need to add it again
+ throw new JoranException("Problem parsing XML document. See previously reported errors.", se);
} catch (Exception ex) {
- handleError(CoreConstants.XML_PARSING_ERROR+ ". Unexpected exception while parsing XML document.", ex);
+ handleError("Unexpected exception while parsing XML document.", ex);
}
throw new IllegalStateException("This point can never be reached");
}
@@ -80,7 +81,7 @@ public class SaxEventRecorder extends DefaultHandler implements ContextAware {
spf.setNamespaceAware(true);
return spf.newSAXParser();
} catch (Exception pce) {
- String errMsg = "Parser configuration error occured";
+ String errMsg = "Parser configuration error occurred";
addError(errMsg, pce);
throw new JoranException(errMsg, pce);
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
index 61d058f..3197407 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
@@ -13,6 +13,7 @@
*/
package ch.qos.logback.core.joran.spi;
+import java.util.ArrayList;
import java.util.List;
import ch.qos.logback.core.joran.event.BodyEvent;
@@ -29,7 +30,16 @@ public class EventPlayer {
public EventPlayer(Interpreter interpreter) {
this.interpreter = interpreter;
}
-
+
+ /**
+ * Return a copy of the current event list in the player.
+ * @return
+ * @since 0.9.20
+ */
+ public List<SaxEvent> getCopyOfPlayerEventList() {
+ return new ArrayList<SaxEvent>(eventList);
+ }
+
public void play(List<SaxEvent> seList) {
eventList = seList;
SaxEvent se;
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/Interpreter.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/Interpreter.java
index 48f074b..3f2698a 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/Interpreter.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/Interpreter.java
@@ -74,7 +74,7 @@ public class Interpreter {
final private CAI_WithLocatorSupport cai;
private Pattern pattern;
Locator locator;
- EventPlayer player;
+ EventPlayer eventPlayer;
/**
* The <id>actionListStack</id> contains a list of actions that are executing
@@ -100,7 +100,11 @@ public class Interpreter {
implicitActions = new ArrayList<ImplicitAction>(3);
this.pattern = initialPattern;
actionListStack = new Stack<List>();
- player = new EventPlayer(this);
+ eventPlayer = new EventPlayer(this);
+ }
+
+ public EventPlayer getEventPlayer() {
+ return eventPlayer;
}
public void setInterpretationContextPropertiesMap(
@@ -327,16 +331,6 @@ public class Interpreter {
public RuleStore getRuleStore() {
return ruleStore;
}
-
- public void play(List<SaxEvent> eventList) {
- player.play(eventList);
- }
-
- public void addEventsDynamically(List<SaxEvent> eventList, int offset) {
- if (player != null) {
- player.addEventsDynamically(eventList, offset);
- }
- }
}
/**
diff --git a/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
index 207db5d..ff82f46 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
@@ -20,6 +20,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import ch.qos.logback.core.Context;
+import ch.qos.logback.core.CoreConstants;
public class StatusChecker {
@@ -46,7 +47,7 @@ public class StatusChecker {
List<Status> filteredList = filterStatusListByTimeThreshold(sm.getCopyOfStatusList(), threshold);
int maxLevel = Status.INFO;
for (Status s : filteredList) {
- if(s.getLevel() > maxLevel)
+ if (s.getLevel() > maxLevel)
maxLevel = s.getLevel();
}
return maxLevel;
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
index f8ce354..236e01a 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
@@ -28,6 +28,8 @@ import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;
import ch.qos.logback.core.CoreConstants;
+import ch.qos.logback.core.db.dialect.SQLDialect;
+import ch.qos.logback.core.util.StatusPrinter;
import org.junit.Test;
import ch.qos.logback.core.Context;
@@ -54,8 +56,7 @@ public class TrivialConfiguratorTest {
TrivialConfigurator trivialConfigurator = new TrivialConfigurator(rulesMap);
trivialConfigurator.setContext(context);
- trivialConfigurator.doConfigure(CoreTestConstants.TEST_DIR_PREFIX
- + "input/joran/" + filename);
+ trivialConfigurator.doConfigure(filename);
}
@Test
@@ -63,7 +64,7 @@ public class TrivialConfiguratorTest {
int oldBeginCount = IncAction.beginCount;
int oldEndCount = IncAction.endCount;
int oldErrorCount = IncAction.errorCount;
- doTest("inc.xml");
+ doTest(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"+"inc.xml");
assertEquals(oldErrorCount, IncAction.errorCount);
assertEquals(oldBeginCount + 1, IncAction.beginCount);
assertEquals(oldEndCount + 1, IncAction.endCount);
@@ -72,35 +73,33 @@ public class TrivialConfiguratorTest {
@Test
public void inexistentFile() {
TrivialStatusListener tsl = new TrivialStatusListener();
- String filename = "nothereBLAH.xml";
+ String filename = CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"
+ + "nothereBLAH.xml";
context.getStatusManager().add(tsl);
try {
doTest(filename);
} catch (Exception e) {
+ assertTrue(e.getMessage().startsWith("Could not open ["));
}
assertTrue(tsl.list.size() + " should be greater than or equal to 1",
- tsl.list.size() >= 1);
+ tsl.list.size() >= 1);
Status s0 = tsl.list.get(0);
- assertTrue(s0.getMessage().startsWith("Could not open [" + filename + "]"));
- }
+ assertTrue(s0.getMessage().startsWith("Could not open ["));
+ }
@Test
public void illFormedXML() {
TrivialStatusListener tsl = new TrivialStatusListener();
- String filename = "illformed.xml";
+ String filename = CoreTestConstants.TEST_DIR_PREFIX + "input/joran/" + "illformed.xml";
context.getStatusManager().add(tsl);
try {
doTest(filename);
} catch (Exception e) {
}
- assertEquals(2, tsl.list.size());
+ assertEquals(1, tsl.list.size());
Status s0 = tsl.list.get(0);
assertTrue(s0.getMessage().startsWith(
- "Parsing fatal error on line 5 and column 3"));
- Status s1 = tsl.list.get(1);
- assertTrue(s1
- .getMessage()
- .startsWith(CoreConstants.XML_PARSING_ERROR));
+ "Parsing fatal error on line 5 and column 3"));
}
@Test
@@ -131,7 +130,7 @@ public class TrivialConfiguratorTest {
URLConnection urlConnection2 = url2.openConnection();
urlConnection2.setUseCaches(false);
InputStream is = urlConnection2.getInputStream();
-
+
TrivialConfigurator tc = new TrivialConfigurator(rulesMap);
tc.setContext(context);
tc.doConfigure(url1);
@@ -149,16 +148,16 @@ public class TrivialConfiguratorTest {
outputDir.mkdirs();
int randomPart = RandomUtil.getPositiveInt();
return new File(CoreTestConstants.OUTPUT_DIR_PREFIX + "foo-" + randomPart
- + ".jar");
+ + ".jar");
}
private void fillInJarFile(File jarFile, String jarEntryName)
- throws IOException {
+ throws IOException {
fillInJarFile(jarFile, jarEntryName, null);
}
private void fillInJarFile(File jarFile, String jarEntryName1,
- String jarEntryName2) throws IOException {
+ String jarEntryName2) throws IOException {
JarOutputStream jos = new JarOutputStream(new FileOutputStream(jarFile));
jos.putNextEntry(new ZipEntry(jarEntryName1));
jos.write("<x/>".getBytes());
-----------------------------------------------------------------------
Summary of changes:
.../classic/turbo/ReconfigureOnChangeFilter.java | 79 +++++++++++++-----
.../classic/turbo/ReconfigureOnChangeTest.java | 88 ++++++++++++++++----
.../java/ch/qos/logback/core/CoreConstants.java | 12 ++--
.../logback/core/joran/GenericConfigurator.java | 46 +++++++---
.../logback/core/joran/action/IncludeAction.java | 2 +-
.../logback/core/joran/conditional/IfAction.java | 2 +-
.../logback/core/joran/event/SaxEventRecorder.java | 9 +-
.../ch/qos/logback/core/joran/spi/EventPlayer.java | 12 +++-
.../ch/qos/logback/core/joran/spi/Interpreter.java | 18 ++---
.../ch/qos/logback/core/status/StatusChecker.java | 3 +-
.../core/joran/TrivialConfiguratorTest.java | 35 ++++----
11 files changed, 211 insertions(+), 95 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
1
0

[JIRA] Created: (LBCLASSIC-277) BLOCKED state on AppenderBase.java:64
by h mahboobi (JIRA) 23 Jun '11
by h mahboobi (JIRA) 23 Jun '11
23 Jun '11
BLOCKED state on AppenderBase.java:64
-------------------------------------
Key: LBCLASSIC-277
URL: http://jira.qos.ch/browse/LBCLASSIC-277
Project: logback-classic
Issue Type: Bug
Components: appender
Affects Versions: 0.9.22
Environment: 64 bit Hardware with 16 processors, 32 GB RAM
SUSE Enterprise Linux 10
Glassfish 2.1.1
JDK 1.6 U15
Reporter: h mahboobi
Assignee: Logback dev list
We're using Logback in high transactional system.
In some cases, our JVM memory abnormally increased and after some minutes, clients could not connect to our services.
Here is dump of JVM threads.
I think there is a problem on logback.
"pool-9-thread-1257" prio=10 tid=0x00002ab04d8c4000 nid=0x6613 waiting for monitor entry [0x000000004ec13000]
java.lang.Thread.State: BLOCKED (on object monitor)
at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:64)
- waiting to lock <0x00002aab31180628> (a ch.qos.logback.classic.sift.SiftingAppender)
at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:64)
at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:283)
at ch.qos.logback.classic.Logger.callAppenders(Logger.java:270)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:471)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:425)
at ch.qos.logback.classic.Logger.debug(Logger.java:532)
at com.kishware.common.log.Slf4jLogger.debug(Slf4jLogger.java:47)
at com.kishware.core.framework.controller.PreOperationController.preOperationControl(PreOperationController.java:109)
at com.kishware.core.framework.controller.PreOperationController$1.call(PreOperationController.java:73)
at com.kishware.core.framework.controller.PreOperationController$1.call(PreOperationController.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
1
1

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-4-g33a24d8
by git-noreply@pixie.qos.ch 20 Jun '11
by git-noreply@pixie.qos.ch 20 Jun '11
20 Jun '11
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 33a24d81695f2a90ed239c0054225992c6be4aab (commit)
from 218b66b5c0c7826c39abbc02e3728ad171bba8f8 (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=33a24d81695f2a90ed239c00…
http://github.com/ceki/logback/commit/33a24d81695f2a90ed239c0054225992c6be4…
commit 33a24d81695f2a90ed239c0054225992c6be4aab
Author: Ceki Gulcu <ceki(a)qos.ch>
Date: Tue Jun 21 00:35:19 2011 +0200
Preparatory work for fixing LBCLASSIC-265. The first step is to detect
SAX exceptions during Joran doConfigure invocation.
diff --git a/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java b/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
index 678373a..dde4d7c 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
@@ -18,6 +18,7 @@ import static org.junit.Assert.assertEquals;
import java.util.Random;
import ch.qos.logback.access.spi.IAccessEvent;
+import ch.qos.logback.core.status.StatusChecker;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -41,6 +42,7 @@ public class DBAppenderIntegrationTest {
int diff = new Random(System.nanoTime()).nextInt(10000);
AccessContext context = new AccessContext();
+ StatusChecker statusChecker = new StatusChecker(context);
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -74,7 +76,7 @@ public class DBAppenderIntegrationTest {
StatusPrinter.print(context);
// check that there were no errors
- assertEquals(Status.INFO, context.getStatusManager().getLevel());
+ assertEquals(Status.INFO, statusChecker.getHighestLevel(0));
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java
index 91661b2..752b1ed 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java
@@ -66,7 +66,7 @@ public class GEventEvaluatorTest {
gee.start();
StatusPrinter.printInCaseOfErrorsOrWarnings(context);
- assertTrue(statusChecker.isErrorFree());
+ assertTrue(statusChecker.isErrorFree(0));
boolean result = gee.evaluate(event);
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
index 2508c2b..aa72ae5 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
@@ -110,7 +110,7 @@ public class DBAppenderIntegrationTest {
// check that there were no errors
StatusChecker checker = new StatusChecker(lc);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbcore211/Lbcore211.java b/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbcore211/Lbcore211.java
new file mode 100644
index 0000000..20cc5d3
--- /dev/null
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbcore211/Lbcore211.java
@@ -0,0 +1,34 @@
+package ch.qos.logback.classic.issue.lbcore211;
+
+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.util.StatusPrinter;
+import org.junit.Test;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Ceki Gücü
+ */
+public class Lbcore211 {
+
+ @Test
+ public void lbcore211() throws JoranException {
+
+ LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
+
+ JoranConfigurator configurator = new JoranConfigurator();
+ configurator.setContext(lc);
+ lc.reset();
+ configurator.doConfigure("/home/ceki/lbcore211.xml");
+
+ Logger l = lc.getLogger("file.logger");
+ StatusPrinter.print(lc);
+ for (int i = 0; i < 10; i++) {
+ l.info("hello " + i);
+ }
+
+ lc.stop();
+ }
+}
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 3d8fb32..54c5f63 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
@@ -302,7 +302,7 @@ public class JoranConfiguratorTest {
StatusPrinter.print(loggerContext);
StatusChecker checker = new StatusChecker(loggerContext);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
assertTrue(checker.containsMatch("Will reset and reconfigure context"));
}
@@ -336,7 +336,7 @@ public class JoranConfiguratorTest {
assertEquals("UTF-8", encoder.getCharset().displayName());
StatusChecker checker = new StatusChecker(loggerContext);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
}
void verifyJULLevel(String loggerName, Level expectedLevel) {
@@ -363,7 +363,7 @@ public class JoranConfiguratorTest {
+ "/jul/levelChangePropagator0.xml";
configure(configFileAsStr);
StatusChecker checker = new StatusChecker(loggerContext);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
verifyJULLevel("xx", null);
verifyJULLevel("a.b.c", Level.WARN);
verifyJULLevel(Logger.ROOT_LOGGER_NAME, Level.TRACE);
@@ -377,7 +377,7 @@ public class JoranConfiguratorTest {
+ "/jul/levelChangePropagator1.xml";
configure(configFileAsStr);
StatusChecker checker = new StatusChecker(loggerContext);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
verifyJULLevel("xx", Level.INFO);
verifyJULLevel("a.b.c", Level.WARN);
verifyJULLevel(Logger.ROOT_LOGGER_NAME, Level.TRACE);
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/joran/conditional/ConditionalTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/joran/conditional/ConditionalTest.java
index 459656f..1d4ee9c 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/joran/conditional/ConditionalTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/joran/conditional/ConditionalTest.java
@@ -80,7 +80,7 @@ public class ConditionalTest {
ConsoleAppender consoleAppender = (ConsoleAppender) root.getAppender("CON");
assertNotNull(consoleAppender);
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
}
@SuppressWarnings("rawtypes")
@@ -97,7 +97,7 @@ public class ConditionalTest {
ConsoleAppender consoleAppender = (ConsoleAppender) root.getAppender("CON");
assertNull(consoleAppender);
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
}
@SuppressWarnings("rawtypes")
@@ -120,7 +120,7 @@ public class ConditionalTest {
// StatusPrinter.printIfErrorsOccured(context);
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
}
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/rolling/TimeBasedRollingWithConfigFileTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/rolling/TimeBasedRollingWithConfigFileTest.java
index 7f4f720..bb9bda4 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/rolling/TimeBasedRollingWithConfigFileTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/rolling/TimeBasedRollingWithConfigFileTest.java
@@ -69,7 +69,7 @@ public class TimeBasedRollingWithConfigFileTest extends
loadConfig(ClassicTestConstants.JORAN_INPUT_PREFIX + "rolling/" + testId
+ ".xml");
StatusChecker sc = new StatusChecker(lc);
- assertTrue(sc.isErrorFree());
+ assertTrue(sc.isErrorFree(0));
Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
@@ -117,7 +117,7 @@ public class TimeBasedRollingWithConfigFileTest extends
.getAppender("ROLLING");
StatusChecker sc = new StatusChecker(lc);
- assertTrue(sc.isErrorFree());
+ assertTrue(sc.isErrorFree(0));
TimeBasedRollingPolicy tprp = (TimeBasedRollingPolicy<ILoggingEvent>) rfa
.getTriggeringPolicy();
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java
index 4c13f00..5624e8c 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/rolling/UniqueFileTest.java
@@ -56,7 +56,7 @@ public class UniqueFileTest {
String timestamp = sdf.format(System.currentTimeMillis());
StatusChecker sc = new StatusChecker(lc);
- assertTrue(sc.isErrorFree());
+ assertTrue(sc.isErrorFree(0));
Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
root.info("hello");
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
index cb21a9f..885e10f 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
@@ -235,7 +235,7 @@ public class ReconfigureOnChangeTest {
void verify(long expectedReconfigurations) {
StatusChecker checker = new StatusChecker(loggerContext);
StatusPrinter.print(loggerContext);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
int effectiveResets = checker
.matchCount("Will reset and reconfigure context");
// the number of effective resets must be equal or less than
diff --git a/logback-classic/src/test/java/org/slf4j/impl/RecursiveInitializationTest.java b/logback-classic/src/test/java/org/slf4j/impl/RecursiveInitializationTest.java
index 1fa41a8..1b4bb16 100644
--- a/logback-classic/src/test/java/org/slf4j/impl/RecursiveInitializationTest.java
+++ b/logback-classic/src/test/java/org/slf4j/impl/RecursiveInitializationTest.java
@@ -15,6 +15,7 @@ package org.slf4j.impl;
import static org.junit.Assert.assertEquals;
+import ch.qos.logback.core.status.StatusChecker;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -56,8 +57,8 @@ public class RecursiveInitializationTest {
LoggerContext loggerContext = (LoggerContext) LoggerFactory
.getILoggerFactory();
StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext);
- StatusManager sm = loggerContext.getStatusManager();
- assertEquals("Was expecting no errors", Status.WARN, sm.getLevel());
+ StatusChecker statusChecker = new StatusChecker(loggerContext);
+ assertEquals("Was expecting no errors", Status.WARN, statusChecker.getHighestLevel(0));
}
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
index d04972e..3c624fa 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
@@ -130,4 +130,5 @@ public class CoreConstants {
public static int BYTES_PER_INT = 4;
public static final int MILLIS_IN_ONE_SECOND = 1000;
+ public final static String XML_PARSING_ERROR = "XML PARSING ERROR";
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
index 294c2ea..9b6ac3a 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
@@ -131,9 +131,11 @@ public abstract class GenericConfigurator extends ContextAwareBase {
synchronized (context.getConfigurationLock()) {
interpreter.play(recorder.saxEventList);
}
+
}
- public void doConfigure(final List<SaxEvent> eventList)
+ // protected since v0.9.30
+ protected void doConfigure(final List<SaxEvent> eventList)
throws JoranException {
buildInterpreter();
EventPlayer player = new EventPlayer(interpreter);
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
index 1b94111..5efbcd0 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
@@ -21,6 +21,7 @@ import java.util.List;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import ch.qos.logback.core.CoreConstants;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
@@ -53,32 +54,36 @@ public class SaxEventRecorder extends DefaultHandler implements ContextAware {
public List<SaxEvent> recordEvents(InputSource inputSource)
throws JoranException {
- SAXParser saxParser = null;
+ SAXParser saxParser = buildSaxParser();
+ try {
+ saxParser.parse(inputSource, this);
+ return saxEventList;
+ } catch (IOException ie) {
+ handleError(CoreConstants.XML_PARSING_ERROR+ ". I/O error occurred while parsing xml file", ie);
+ } catch(SAXException se) {
+ handleError(CoreConstants.XML_PARSING_ERROR+ ". Problem parsing XML document. See previously reported errors.", se);
+ } catch (Exception ex) {
+ handleError(CoreConstants.XML_PARSING_ERROR+ ". Unexpected exception while parsing XML document.", ex);
+ }
+ throw new IllegalStateException("This point can never be reached");
+ }
+
+ private void handleError(String errMsg, Throwable t) throws JoranException {
+ addError(errMsg, t);
+ throw new JoranException(errMsg, t);
+ }
+
+ private SAXParser buildSaxParser() throws JoranException {
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
spf.setNamespaceAware(true);
- saxParser = spf.newSAXParser();
+ return spf.newSAXParser();
} catch (Exception pce) {
String errMsg = "Parser configuration error occured";
addError(errMsg, pce);
throw new JoranException(errMsg, pce);
}
-
- try {
- saxParser.parse(inputSource, this);
- return saxEventList;
-
- } catch (IOException ie) {
- String errMsg = "I/O error occurred while parsing xml file";
- addError(errMsg, ie);
- throw new JoranException(errMsg, ie);
- } catch (Exception ex) {
- String errMsg = "Problem parsing XML document. See previously reported errors. Abandoning all further processing.";
- addError(errMsg, ex);
- throw new JoranException(errMsg, ex);
- }
-
}
public void startDocument() {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/sift/SiftingJoranConfiguratorBase.java b/logback-core/src/main/java/ch/qos/logback/core/sift/SiftingJoranConfiguratorBase.java
index 2a5184e..b5d5643 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/sift/SiftingJoranConfiguratorBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/sift/SiftingJoranConfiguratorBase.java
@@ -13,6 +13,7 @@
*/
package ch.qos.logback.core.sift;
+import java.util.List;
import java.util.Map;
import ch.qos.logback.core.Appender;
@@ -20,7 +21,9 @@ import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.joran.GenericConfigurator;
import ch.qos.logback.core.joran.action.NestedBasicPropertyIA;
import ch.qos.logback.core.joran.action.NestedComplexPropertyIA;
+import ch.qos.logback.core.joran.event.SaxEvent;
import ch.qos.logback.core.joran.spi.Interpreter;
+import ch.qos.logback.core.joran.spi.JoranException;
public abstract class SiftingJoranConfiguratorBase<E> extends
GenericConfigurator {
@@ -57,6 +60,9 @@ public abstract class SiftingJoranConfiguratorBase<E> extends
if (errMsg != null && errorEmmissionCount < CoreConstants.MAX_ERROR_COUNT) {
addError(errMsg);
}
+ }
+ public void doConfigure(final List<SaxEvent> eventList) throws JoranException {
+ super.doConfigure(eventList);
}
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/status/StatusChecker.java b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
similarity index 64%
rename from logback-core/src/test/java/ch/qos/logback/core/status/StatusChecker.java
rename to logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
index 2d023ab..207db5d 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/status/StatusChecker.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
@@ -1,93 +1,113 @@
-/**
- * Logback: the reliable, generic, fast and flexible logging framework.
- * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
- *
- * This program and the accompanying materials are dual-licensed under
- * either the terms of the Eclipse Public License v1.0 as published by
- * the Eclipse Foundation
- *
- * or (per the licensee's choosing)
- *
- * under the terms of the GNU Lesser General Public License version 2.1
- * as published by the Free Software Foundation.
- */
-package ch.qos.logback.core.status;
-
-import java.util.Iterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import ch.qos.logback.core.Context;
-
-public class StatusChecker {
-
- StatusManager sm;
-
- public StatusChecker(StatusManager sm) {
- this.sm = sm;
- }
-
- public StatusChecker(Context context) {
- this.sm = context.getStatusManager();
- }
-
- public boolean isErrorFree() {
- int level = sm.getLevel();
- return level < Status.ERROR;
- }
-
- public boolean containsMatch(int level, String regex) {
- Pattern p = Pattern.compile(regex);
-
- for(Status status: sm.getCopyOfStatusList()) {
- if(level != status.getLevel()) {
- continue;
- }
- String msg = status.getMessage();
- Matcher matcher = p.matcher(msg);
- if (matcher.lookingAt()) {
- return true;
- }
- }
- return false;
-
- }
-
- public boolean containsMatch(String regex) {
- Pattern p = Pattern.compile(regex);
- for(Status status: sm.getCopyOfStatusList()) {
- String msg = status.getMessage();
- Matcher matcher = p.matcher(msg);
- if (matcher.lookingAt()) {
- return true;
- }
- }
- return false;
- }
-
- public int matchCount(String regex) {
- int count = 0;
- Pattern p = Pattern.compile(regex);
- for(Status status: sm.getCopyOfStatusList()) {
- String msg = status.getMessage();
- Matcher matcher = p.matcher(msg);
- if (matcher.lookingAt()) {
- count++;
- }
- }
- return count;
- }
-
- public boolean containsException(Class exceptionType) {
- Iterator stati = sm.getCopyOfStatusList().iterator();
- while (stati.hasNext()) {
- Status status = (Status) stati.next();
- Throwable t = status.getThrowable();
- if (t != null && t.getClass().getName().equals(exceptionType.getName())) {
- return true;
- }
- }
- return false;
- }
-
-}
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
+ *
+ * This program and the accompanying materials are dual-licensed under
+ * either the terms of the Eclipse Public License v1.0 as published by
+ * the Eclipse Foundation
+ *
+ * or (per the licensee's choosing)
+ *
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ */
+package ch.qos.logback.core.status;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import ch.qos.logback.core.Context;
+
+public class StatusChecker {
+
+ StatusManager sm;
+
+ public StatusChecker(StatusManager sm) {
+ this.sm = sm;
+ }
+
+ public StatusChecker(Context context) {
+ this.sm = context.getStatusManager();
+ }
+
+ private List<Status> filterStatusListByTimeThreshold(List<Status> rawList, long threshold) {
+ List<Status> filteredList = new ArrayList<Status>();
+ for (Status s : rawList) {
+ if (s.getDate() >= threshold)
+ filteredList.add(s);
+ }
+ return filteredList;
+ }
+
+ public int getHighestLevel(long threshold) {
+ List<Status> filteredList = filterStatusListByTimeThreshold(sm.getCopyOfStatusList(), threshold);
+ int maxLevel = Status.INFO;
+ for (Status s : filteredList) {
+ if(s.getLevel() > maxLevel)
+ maxLevel = s.getLevel();
+ }
+ return maxLevel;
+ }
+
+ public boolean isErrorFree(long threshold) {
+ return Status.ERROR > getHighestLevel(threshold);
+ }
+
+ public boolean containsMatch(int level, String regex) {
+ Pattern p = Pattern.compile(regex);
+
+ for (Status status : sm.getCopyOfStatusList()) {
+ if (level != status.getLevel()) {
+ continue;
+ }
+ String msg = status.getMessage();
+ Matcher matcher = p.matcher(msg);
+ if (matcher.lookingAt()) {
+ return true;
+ }
+ }
+ return false;
+
+ }
+
+ public boolean containsMatch(String regex) {
+ Pattern p = Pattern.compile(regex);
+ for (Status status : sm.getCopyOfStatusList()) {
+ String msg = status.getMessage();
+ Matcher matcher = p.matcher(msg);
+ if (matcher.lookingAt()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int matchCount(String regex) {
+ int count = 0;
+ Pattern p = Pattern.compile(regex);
+ for (Status status : sm.getCopyOfStatusList()) {
+ String msg = status.getMessage();
+ Matcher matcher = p.matcher(msg);
+ if (matcher.lookingAt()) {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ public boolean containsException(Class exceptionType) {
+ Iterator stati = sm.getCopyOfStatusList().iterator();
+ while (stati.hasNext()) {
+ Status status = (Status) stati.next();
+ Throwable t = status.getThrowable();
+ if (t != null && t.getClass().getName().equals(exceptionType.getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/status/StatusManager.java b/logback-core/src/main/java/ch/qos/logback/core/status/StatusManager.java
index 46410cd..f64fa7c 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/status/StatusManager.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/status/StatusManager.java
@@ -41,7 +41,7 @@ public interface StatusManager {
*
* @return
*/
- public int getLevel();
+ //public int getLevel();
/**
* Return the number of status entries.
diff --git a/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java b/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
index 4f60696..40394cd 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
@@ -22,6 +22,7 @@ import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.helpers.ThrowableToStringArray;
import ch.qos.logback.core.status.ErrorStatus;
import ch.qos.logback.core.status.Status;
+import ch.qos.logback.core.status.StatusChecker;
import ch.qos.logback.core.status.StatusManager;
public class StatusPrinter {
@@ -51,7 +52,8 @@ public class StatusPrinter {
ps.println("WARN: Context named \"" + context.getName()
+ "\" has no status manager");
} else {
- if (sm.getLevel() == ErrorStatus.WARN || (sm.getLevel() == ErrorStatus.ERROR) ) {
+ StatusChecker sc = new StatusChecker(context);
+ if (sc.getHighestLevel(0) >= ErrorStatus.WARN) {
print(sm);
}
}
@@ -73,7 +75,8 @@ public class StatusPrinter {
ps.println("WARN: Context named \"" + context.getName()
+ "\" has no status manager");
} else {
- if (sm.getLevel() == ErrorStatus.ERROR) {
+ StatusChecker sc = new StatusChecker(context);
+ if (sc.getHighestLevel(0) == ErrorStatus.ERROR) {
print(sm);
}
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java b/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java
index 3a9616a..0250640 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/appender/FileAppenderTest.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.util.List;
+import ch.qos.logback.core.status.StatusChecker;
import org.junit.Test;
import ch.qos.logback.core.Appender;
@@ -110,8 +111,9 @@ public class FileAppenderTest extends AbstractAppenderTest<Object> {
assertTrue(appender.isAppend());
StatusManager sm = context.getStatusManager();
- StatusPrinter.print(context);
- assertEquals(Status.WARN, sm.getLevel());
+ //StatusPrinter.print(context);
+ StatusChecker statusChecker = new StatusChecker(context);
+ assertEquals(Status.WARN, statusChecker.getHighestLevel(0));
List<Status> statusList = sm.getCopyOfStatusList();
assertTrue("Expecting status list size to be 2 or larger, but was "
+ statusList.size(), statusList.size() >= 2);
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
index a09fedc..f8ce354 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
@@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;
+import ch.qos.logback.core.CoreConstants;
import org.junit.Test;
import ch.qos.logback.core.Context;
@@ -99,8 +100,7 @@ public class TrivialConfiguratorTest {
Status s1 = tsl.list.get(1);
assertTrue(s1
.getMessage()
- .startsWith(
- "Problem parsing XML document. See previously reported errors. Abandoning all further processing."));
+ .startsWith(CoreConstants.XML_PARSING_ERROR));
}
@Test
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/action/IncludeActionTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/action/IncludeActionTest.java
index 9c26831..379a804 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/action/IncludeActionTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/action/IncludeActionTest.java
@@ -51,6 +51,7 @@ public class IncludeActionTest {
final static String SECOND_FILE_KEY = "secondFileKey";
Context context = new ContextBase();
+ StatusChecker statusChecker = new StatusChecker(context);
TrivialConfigurator tc;
static final String INCLUSION_DIR_PREFIX = CoreTestConstants.JORAN_INPUT_PREFIX
@@ -130,9 +131,8 @@ public class IncludeActionTest {
public void noFileFound() throws JoranException {
System.setProperty(INCLUDE_KEY, "toto");
tc.doConfigure(TOP_BY_FILE);
- assertEquals(Status.ERROR, context.getStatusManager().getLevel());
- StatusChecker sc = new StatusChecker(context.getStatusManager());
- assertTrue(sc.containsException(FileNotFoundException.class));
+ assertEquals(Status.ERROR, statusChecker.getHighestLevel(0));
+ assertTrue(statusChecker.containsException(FileNotFoundException.class));
}
@Test
@@ -140,9 +140,8 @@ public class IncludeActionTest {
String tmpOut = copyToTemp(INVALID);
System.setProperty(INCLUDE_KEY, tmpOut);
tc.doConfigure(TOP_BY_FILE);
- assertEquals(Status.ERROR, context.getStatusManager().getLevel());
- StatusChecker sc = new StatusChecker(context.getStatusManager());
- assertTrue(sc.containsException(SAXParseException.class));
+ assertEquals(Status.ERROR, statusChecker.getHighestLevel(0));
+ assertTrue(statusChecker.containsException(SAXParseException.class));
// we like to erase the temp file in order to see
// if http://jira.qos.ch/browse/LBCORE-122 was fixed
@@ -169,23 +168,20 @@ public class IncludeActionTest {
public void malformedURL() throws JoranException {
System.setProperty(INCLUDE_KEY, "htp://logback.qos.ch");
tc.doConfigure(TOP_BY_URL);
- assertEquals(Status.ERROR, context.getStatusManager().getLevel());
- StatusChecker sc = new StatusChecker(context.getStatusManager());
- assertTrue(sc.containsException(MalformedURLException.class));
+ assertEquals(Status.ERROR, statusChecker.getHighestLevel(0));
+ assertTrue(statusChecker.containsException(MalformedURLException.class));
}
@Test
public void unknownURL() throws JoranException {
System.setProperty(INCLUDE_KEY, "http://logback2345.qos.ch");
tc.doConfigure(TOP_BY_URL);
- assertEquals(Status.ERROR, context.getStatusManager().getLevel());
- StatusChecker sc = new StatusChecker(context.getStatusManager());
-
+ assertEquals(Status.ERROR, statusChecker.getHighestLevel(0));
// OS X throws IOException instead of UnknownHostException
// http://jira.qos.ch/browse/LBCORE-129
// This behavior has been observed on Windows XP as well
- assertTrue(sc.containsException(UnknownHostException.class)
- || sc.containsException(IOException.class));
+ assertTrue(statusChecker.containsException(UnknownHostException.class)
+ || statusChecker.containsException(IOException.class));
}
@Test
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/conditional/IfThenElseTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/conditional/IfThenElseTest.java
index 30a042f..86acd87 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/conditional/IfThenElseTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/conditional/IfThenElseTest.java
@@ -95,7 +95,7 @@ public class IfThenElseTest {
tc.doConfigure(CONDITIONAL_DIR_PREFIX+"ifWithoutElse.xml");
verifyConfig(new String[] {"BEGIN", "END"});
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/event/SaxEventRecorderTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/event/SaxEventRecorderTest.java
index c7f7552..9a68ef7 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/event/SaxEventRecorderTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/event/SaxEventRecorderTest.java
@@ -21,6 +21,7 @@ import java.util.List;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import ch.qos.logback.core.status.StatusChecker;
import org.junit.Test;
import org.xml.sax.Attributes;
@@ -38,7 +39,7 @@ import ch.qos.logback.core.util.CoreTestConstants;
public class SaxEventRecorderTest {
Context context = new ContextBase();
-
+ StatusChecker statusChecker = new StatusChecker(context);
SAXParser createParser() throws Exception {
SAXParserFactory spf = SAXParserFactory.newInstance();
@@ -65,8 +66,7 @@ public class SaxEventRecorderTest {
@Test
public void test1() throws Exception {
List<SaxEvent> seList = doTest("event1.xml");
- StatusManager sm = context.getStatusManager();
- assertTrue(sm.getLevel() == Status.INFO);
+ assertTrue(statusChecker.getHighestLevel(0) == Status.INFO);
//dump(seList);
assertEquals(11, seList.size());
}
@@ -75,7 +75,7 @@ public class SaxEventRecorderTest {
public void test2() throws Exception {
List<SaxEvent> seList = doTest("ampEvent.xml");
StatusManager sm = context.getStatusManager();
- assertTrue(sm.getLevel() == Status.INFO);
+ assertTrue(statusChecker.getHighestLevel(0) == Status.INFO);
//dump(seList);
assertEquals(3, seList.size());
@@ -87,8 +87,8 @@ public class SaxEventRecorderTest {
public void test3() throws Exception {
List<SaxEvent> seList = doTest("inc.xml");
StatusManager sm = context.getStatusManager();
- assertTrue(sm.getLevel() == Status.INFO);
- //dump(seList);
+ assertTrue(statusChecker.getHighestLevel(0) == Status.INFO);
+ //dump(seList);
assertEquals(4, seList.size());
StartEvent se = (StartEvent) seList.get(1);
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/MultiThreadedRollingTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/MultiThreadedRollingTest.java
index 3084601..8e056e2 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/MultiThreadedRollingTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/MultiThreadedRollingTest.java
@@ -255,7 +255,7 @@ public class MultiThreadedRollingTest {
multiThreadedHarness.execute(runnableArray);
StatusChecker checker = new StatusChecker(context.getStatusManager());
- if (!checker.isErrorFree()) {
+ if (!checker.isErrorFree(0)) {
StatusPrinter.print(context);
fail("errors reported");
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java
index fd8888b..05f5891 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java
@@ -68,7 +68,7 @@ public class RenameUtilTest {
renameUtil.rename(fromFile.toString(), new File(randomTARGETDir + "/to.test").toString());
StatusPrinter.printInCaseOfErrorsOrWarnings(context);
- assertTrue(statusChecker.isErrorFree());
+ assertTrue(statusChecker.isErrorFree(0));
}
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/RollingFileAppenderTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/RollingFileAppenderTest.java
index 718a66b..d1b2b06 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/RollingFileAppenderTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/RollingFileAppenderTest.java
@@ -107,9 +107,9 @@ public class RollingFileAppenderTest extends AbstractAppenderTest<Object> {
rfa.start();
- StatusManager sm = context.getStatusManager();
+ StatusChecker checker = new StatusChecker(context);
assertFalse(rfa.isStarted());
- assertEquals(Status.ERROR, sm.getLevel());
+ assertEquals(Status.ERROR, checker.getHighestLevel(0));
}
@Test
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/CompressTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/CompressTest.java
index 865a579..a08db12 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/CompressTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/CompressTest.java
@@ -87,7 +87,7 @@ public class CompressTest {
+ "compress1.txt.gz", null);
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
assertTrue(Compare.gzCompare(CoreTestConstants.OUTPUT_DIR_PREFIX
+ "compress1.txt.gz", CoreTestConstants.TEST_DIR_PREFIX
+ "witness/compress1.txt.gz"));
@@ -102,7 +102,7 @@ public class CompressTest {
+ "compress2.txt", null);
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
assertTrue(Compare.gzCompare(CoreTestConstants.OUTPUT_DIR_PREFIX
+ "compress2.txt.gz", CoreTestConstants.TEST_DIR_PREFIX
@@ -117,7 +117,7 @@ public class CompressTest {
+ "input/compress3.txt", CoreTestConstants.OUTPUT_DIR_PREFIX
+ "compress3.txt", "compress3.txt");
StatusChecker checker = new StatusChecker(context);
- assertTrue(checker.isErrorFree());
+ assertTrue(checker.isErrorFree(0));
// we don't know how to compare .zip files
// assertTrue(Compare.compare(CoreTestConstants.OUTPUT_DIR_PREFIX
-----------------------------------------------------------------------
Summary of changes:
.../access/db/DBAppenderIntegrationTest.java | 4 +-
.../classic/boolex/GEventEvaluatorTest.java | 2 +-
.../classic/db/DBAppenderIntegrationTest.java | 2 +-
.../logback/classic/issue/lbcore211/Lbcore211.java | 34 ++++
.../classic/joran/JoranConfiguratorTest.java | 8 +-
.../classic/joran/conditional/ConditionalTest.java | 6 +-
.../TimeBasedRollingWithConfigFileTest.java | 4 +-
.../logback/classic/rolling/UniqueFileTest.java | 2 +-
.../classic/turbo/ReconfigureOnChangeTest.java | 2 +-
.../slf4j/impl/RecursiveInitializationTest.java | 5 +-
.../java/ch/qos/logback/core/CoreConstants.java | 1 +
.../logback/core/joran/GenericConfigurator.java | 4 +-
.../logback/core/joran/event/SaxEventRecorder.java | 39 ++--
.../core/sift/SiftingJoranConfiguratorBase.java | 6 +
.../ch/qos/logback/core/status/StatusChecker.java | 206 +++++++++++---------
.../ch/qos/logback/core/status/StatusManager.java | 2 +-
.../ch/qos/logback/core/util/StatusPrinter.java | 7 +-
.../logback/core/appender/FileAppenderTest.java | 6 +-
.../core/joran/TrivialConfiguratorTest.java | 4 +-
.../core/joran/action/IncludeActionTest.java | 24 +--
.../core/joran/conditional/IfThenElseTest.java | 2 +-
.../core/joran/event/SaxEventRecorderTest.java | 12 +-
.../core/rolling/MultiThreadedRollingTest.java | 2 +-
.../qos/logback/core/rolling/RenameUtilTest.java | 2 +-
.../core/rolling/RollingFileAppenderTest.java | 4 +-
.../logback/core/rolling/helper/CompressTest.java | 6 +-
26 files changed, 234 insertions(+), 162 deletions(-)
create mode 100644 logback-classic/src/test/java/ch/qos/logback/classic/issue/lbcore211/Lbcore211.java
rename logback-core/src/{test => main}/java/ch/qos/logback/core/status/StatusChecker.java (64%)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
1
0

[JIRA] Created: (LBCORE-211) HTMLLayout and LayoutWrappingEncoder produces invalid/unusuable output
by Jessica-Aileen Alten (JIRA) 20 Jun '11
by Jessica-Aileen Alten (JIRA) 20 Jun '11
20 Jun '11
HTMLLayout and LayoutWrappingEncoder produces invalid/unusuable output
----------------------------------------------------------------------
Key: LBCORE-211
URL: http://jira.qos.ch/browse/LBCORE-211
Project: logback-core
Issue Type: Bug
Affects Versions: 0.9.29
Environment: Windows Server 2008 R2 64 bit, JDK 1.6.0_26
Reporter: Jessica-Aileen Alten
Assignee: Logback dev list
HTMLLayout and LayoutWrappingEncoder are producing unusuable HTML output, the HTML file isn't closed by </table></body></html>. When you are using the append element, a new logging event produces the complete html header, headlines and table header.
Configuration:
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>../../logs/server_nodes.html</file>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.html.HTMLLayout">
<pattern>%d{ISO8601}%msg</pattern>
</layout>
</encoder>
<append>true</append>
</appender>
<logger name="file.logger" additivity="false">
<level value="info" />
<appender-ref ref="FILE" />
</logger>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
2
4

[JIRA] Created: (LBCLASSIC-247) ConfigurationWatchList produces a warinig a correct configuration
by Michael Franz (JIRA) 16 Jun '11
by Michael Franz (JIRA) 16 Jun '11
16 Jun '11
ConfigurationWatchList produces a warinig a correct configuration
-----------------------------------------------------------------
Key: LBCLASSIC-247
URL: http://jira.qos.ch/browse/LBCLASSIC-247
Project: logback-classic
Issue Type: Bug
Components: joran
Affects Versions: 0.9.28
Reporter: Michael Franz
Assignee: Logback dev list
I get the following warning for included files:
12:09:40,657 |-WARN in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@7c959fa1 - Null ConfigurationWatchList. Cannot add file:/D:/dev/.../logback-lilith.xml
Scanning is off.
I configure logback in the following way:
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(loggerContext);
loggerContext.reset();
configurator.doConfigure(new ByteArrayInputStream(config.getBytes("UTF-8")));
The generated main configuration (variable config) contains mainly includes to files within the file system.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
2
8

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-3-g218b66b
by git-noreply@pixie.qos.ch 16 Jun '11
by git-noreply@pixie.qos.ch 16 Jun '11
16 Jun '11
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 218b66b5c0c7826c39abbc02e3728ad171bba8f8 (commit)
via b05d1c484c617f22522dd2094a04f87a78447afe (commit)
from 02da05ef77822b6b78669c65ab463f8f3f2240ba (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=218b66b5c0c7826c39abbc02…
http://github.com/ceki/logback/commit/218b66b5c0c7826c39abbc02e3728ad171bba…
commit 218b66b5c0c7826c39abbc02e3728ad171bba8f8
Merge: 02da05e b05d1c4
Author: Ceki Gulcu <ceki(a)qos.ch>
Date: Thu Jun 16 11:35:39 2011 +0200
Merge branch 'typo_fixes' of git://github.com/datafueled/logback
diff --cc logback-site/src/site/pages/news.html
index 58e1821,a4f41e6..fb530d1
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@@ -40,27 -40,17 +40,27 @@@
MDC.clear operation. This issue was reported in <a
href="http://jira.qos.ch/browse/LBCLASSIC-253">LBCLASSIC-253</a>
by Tommy Becker and independently fixed by the changes designated
- to fix LBCLASSIC-254</p>.
+ to fix LBCLASSIC-254.</p>
+
+ <p>As reported by Deepak Vadgama in <a
+ href="http://jira.qos.ch/browse/LBCORE-199">LBCORE-199</a>, the
+ entry in every zip file created by
+ <code>FixedWindowRollingPolicy</code> had the same name. The issue
+ was solved by adding a timestamp to the name of the entry in the
+ zip files as suggested by a Benoit Xhenseval.</p>
<p><code>ConfigurationWatchList</code> no longer emits an error
- message when it encouters a configuraton file placed in a jar
+ message when it encounters a configuration file placed in a jar
file, fixing <a
href="http://jira.qos.ch/browse/LBCLASSIC-246">LBCLASSIC-246</a>
- as reported by Joern Huxhorn.
+ as reported by Joern Huxhorn. This release also fixes <a
+ href="http://jira.qos.ch/browse/LBCLASSIC-247">LBCLASSIC-247</a>
+ reported by Michael Franz.
</p>
+
<p>Logback now emits a clearer error message in case a conversion
- pattern misses a closing parenthesis or if an openening
+ pattern misses a closing parenthesis or if an opening
parenthesis is misplaced. This fixes <a
href="http://jira.qos.ch/browse/LBCORE-193">LBCORE-193</a>
reported by B. K. Oxley.</p>
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=b05d1c484c617f22522dd209…
http://github.com/ceki/logback/commit/b05d1c484c617f22522dd2094a04f87a78447…
commit b05d1c484c617f22522dd2094a04f87a78447afe
Author: Bruce Mitchener <bruce.mitchener(a)gmail.com>
Date: Mon May 2 13:49:27 2011 +0700
Fix typos.
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java
index e234c90..ed1f7a5 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java
@@ -19,7 +19,7 @@ import ch.qos.logback.access.spi.IAccessEvent;
* Always returns the NA (not available) string which is "-" in the case
* of access conversions.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class NAConverter extends AccessConverter {
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java
index a66fd18..8118919 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java
@@ -18,7 +18,7 @@ import ch.qos.logback.access.spi.IAccessEvent;
/**
* The request URI.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class RequestURIConverter extends AccessConverter {
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java
index 473326e..05b7b99 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java
@@ -18,7 +18,7 @@ import ch.qos.logback.access.spi.IAccessEvent;
/**
* The first line of the request.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class RequestURLConverter extends AccessConverter {
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java b/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
index c492817..47ca742 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
@@ -39,7 +39,7 @@ import ch.qos.logback.core.status.WarnStatus;
/**
* LoggerContext glues many of the logback-classic components together. In
* principle, every logback-classic component instance is attached either
- * directly or indirecty to a LoggerContext instance. Just as importantly
+ * directly or indirectly to a LoggerContext instance. Just as importantly
* LoggerContext implements the {@link ILoggerFactory} acting as the
* manufacturing source of {@link Logger} instances.
*
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/db/package.html b/logback-classic/src/main/java/ch/qos/logback/classic/db/package.html
index a696aa0..7bc5610 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/db/package.html
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/db/package.html
@@ -16,7 +16,7 @@ are supported.
</p>
<p>Just as importantly, the way for obtaining JDBC connections is pluggable. Connections can
-be obtained through the tradinal way of DriverManager, or alternatively as a DataSource.
+be obtained through the traditional way of DriverManager, or alternatively as a DataSource.
A DataSource can be instantiated directly or it can obtained through JNDI.
</p>
</body>
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java b/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
index 2679c2f..42a0f85 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
@@ -101,7 +101,7 @@ public class SimpleSocketServer extends Thread {
}
/**
- * Signal another thread that we have established a conneciton
+ * Signal another thread that we have established a connection
* This is useful for testing purposes.
*/
void signalAlmostReadiness() {
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java b/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
index 67845db..583033e 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
@@ -31,7 +31,7 @@ import ch.qos.logback.core.net.SyslogAppenderBase;
* more information about this appender, please refer to the online manual at
* http://logback.qos.ch/manual/appenders.html#SyslogAppender
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class SyslogAppender extends SyslogAppenderBase<ILoggingEvent> {
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggerContextAwareBase.java b/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggerContextAwareBase.java
index b018fa6..4acb929 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggerContextAwareBase.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggerContextAwareBase.java
@@ -30,7 +30,7 @@ public class LoggerContextAwareBase extends ContextAwareBase implements LoggerCo
public void setContext(Context context) {
// check that the context is of type LoggerContext. Otherwise, throw an exception
- // Context == null is a degenarate case but nonetheless permitted.
+ // Context == null is a degenerate case but nonetheless permitted.
if(context instanceof LoggerContext || context == null) {
super.setContext(context);
} else {
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java b/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java
index 8cbf883..b23373d 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java
@@ -66,7 +66,7 @@ public class LoggingEvent implements ILoggingEvent {
* Level of logging event.
*
* <p>
- * This field should not be accessed directly. You shoud use the
+ * This field should not be accessed directly. You should use the
* {@link #getLevel} method instead.
* </p>
*
@@ -77,7 +77,7 @@ public class LoggingEvent implements ILoggingEvent {
// we gain significant space at serialization time by marking
// formattedMessage as transient and constructing it lazily in
- // getFormmatedMessage()
+ // getFormattedMessage()
private transient String formattedMessage;
private transient Object[] argumentArray;
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEventVO.java b/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEventVO.java
index d8228d2..26c66a4 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEventVO.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEventVO.java
@@ -48,7 +48,7 @@ public class LoggingEventVO implements ILoggingEvent, Serializable {
// we gain significant space at serialization time by marking
// formattedMessage as transient and constructing it lazily in
- // getFormmatedMessage()
+ // getFormattedMessage()
private transient String formattedMessage;
private transient Object[] argumentArray;
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MDCFilter.java b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MDCFilter.java
index 111db11..1aed275 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MDCFilter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MDCFilter.java
@@ -24,7 +24,7 @@ import ch.qos.logback.core.spi.FilterReply;
* This class allows output for a given MDC value.
*
* <p>
- * When the given value is identified by this TubroFilter,
+ * When the given value is identified by this TurboFilter,
* the reply is based on the OnMatch option.
* The information is taken from the MDC. For this TurboFilter to work,
* one must set the key that will be used to
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MatchingFilter.java b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MatchingFilter.java
index a4da3a9..09c25c7 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MatchingFilter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/MatchingFilter.java
@@ -17,7 +17,7 @@ import ch.qos.logback.core.spi.FilterReply;
/**
* An abstract class containing support for {@link #onMatch} on {@link #onMismatch}
- * attributes, shared by many but not all tubo filters.
+ * attributes, shared by many but not all turbo filters.
*
* @author Ceki Gulcu
*/
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextSelectorStaticBinder.java b/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextSelectorStaticBinder.java
index a2d9a02..fb7247f 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextSelectorStaticBinder.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextSelectorStaticBinder.java
@@ -75,7 +75,7 @@ public class ContextSelectorStaticBinder {
}
/**
- * Intantiate the context selector class designated by the user. The selector
+ * Instantiate the context selector class designated by the user. The selector
* must have a constructor taking a LoggerContext instance as an argument.
*
* @param defaultLoggerContext
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/mock/MockSyslogServer.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/mock/MockSyslogServer.java
index b85344b..7757bf5 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/mock/MockSyslogServer.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/mock/MockSyslogServer.java
@@ -20,7 +20,7 @@ import java.util.List;
/**
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class MockSyslogServer extends Thread {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/boolex/EvaluationException.java b/logback-core/src/main/java/ch/qos/logback/core/boolex/EvaluationException.java
index 621c90a..7af4803 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/boolex/EvaluationException.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/boolex/EvaluationException.java
@@ -16,7 +16,7 @@ package ch.qos.logback.core.boolex;
/**
* This exception wraps exceptions thrown while evaluating events.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class EvaluationException extends Exception {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/db/package.html b/logback-core/src/main/java/ch/qos/logback/core/db/package.html
index 213e220..a3ff88d 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/db/package.html
+++ b/logback-core/src/main/java/ch/qos/logback/core/db/package.html
@@ -15,7 +15,7 @@ are supported.
</p>
<p>Just as importantly, the way for obtaining JDBC connections is pluggable. Connections can
-be obtained through the tradinal way of DriverManager, or alternatively as a DataSource.
+be obtained through the traditional way of DriverManager, or alternatively as a DataSource.
A DataSource can be instantiated directly or it can obtained through JNDI.
</p>
</body>
diff --git a/logback-core/src/main/java/ch/qos/logback/core/filter/package.html b/logback-core/src/main/java/ch/qos/logback/core/filter/package.html
index c757da6..6d5ee0f 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/filter/package.html
+++ b/logback-core/src/main/java/ch/qos/logback/core/filter/package.html
@@ -7,7 +7,7 @@
<body>
- <p>Contains base classes to the event filtering functionnalities of logback.</p>
+ <p>Contains base classes to the event filtering functionality of logback.</p>
</body>
</html>
\ No newline at end of file
diff --git a/logback-core/src/main/java/ch/qos/logback/core/helpers/Transform.java b/logback-core/src/main/java/ch/qos/logback/core/helpers/Transform.java
index 3642005..34c32e8 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/helpers/Transform.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/helpers/Transform.java
@@ -69,7 +69,7 @@ public class Transform {
/**
- * Ensures that embeded CDEnd strings (]]>) are handled properly within
+ * Ensures that embedded CDEnd strings (]]>) are handled properly within
* message, NDC and throwable tag text.
*
* @param output
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/JMSAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/JMSAppenderBase.java
index d5d8f90..cc08be4 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/JMSAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/JMSAppenderBase.java
@@ -167,7 +167,7 @@ public abstract class JMSAppenderBase<E> extends AppenderBase<E> {
}
/**
- * The paswword to use when creating a topic session.
+ * The password to use when creating a topic session.
*/
public void setPassword(String password) {
this.password = password;
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
index f3bb08c..5e88e59 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
@@ -92,7 +92,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
private int errorCount = 0;
/**
- * return a layout for the subjet string as appropriate for the module. If the
+ * return a layout for the subject string as appropriate for the module. If the
* subjectStr parameter is null, then a default value for subjectStr should be
* used.
*
@@ -342,7 +342,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
mimeMsg.setSentDate(new Date());
Transport.send(mimeMsg);
} catch (Exception e) {
- addError("Error occured while sending e-mail notification.", e);
+ addError("Error occurred while sending e-mail notification.", e);
}
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java
index 6b2fb5c..b77f509 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/SocketAppenderBase.java
@@ -263,7 +263,7 @@ public abstract class SocketAppenderBase<E> extends AppenderBase<E> {
*
* <p>
* It stops trying whenever a connection is established. It will restart to
- * try reconnect to the server when previpously open connection is droppped.
+ * try reconnect to the server when previously open connection is dropped.
*
* @author Ceki Gülcü
* @since 0.8.4
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java
index d0cf074..64b4e4e 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/SyslogAppenderBase.java
@@ -25,7 +25,7 @@ import ch.qos.logback.core.Layout;
/**
* Base class for SyslogAppender.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*
* @param <E>
*/
@@ -201,7 +201,7 @@ public abstract class SyslogAppenderBase<E> extends AppenderBase<E> {
}
/**
- * The port number on the syslog server to connect to. Nornally, wou would not
+ * The port number on the syslog server to connect to. Normally, you would not
* want to change the default value, that is 514.
*/
public void setPort(int port) {
@@ -233,8 +233,8 @@ public abstract class SyslogAppenderBase<E> extends AppenderBase<E> {
}
/**
- * The <b>suffixPattern</b> option specifies the fortmat of the
- * non-standardized part the message sent to the syslog server.
+ * The <b>suffixPattern</b> option specifies the format of the
+ * non-standardized part of the message sent to the syslog server.
*
* @param pattern
*/
diff --git a/logback-core/src/main/java/ch/qos/logback/core/pattern/FormatInfo.java b/logback-core/src/main/java/ch/qos/logback/core/pattern/FormatInfo.java
index 1f6c9a5..bfbd303 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/pattern/FormatInfo.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/pattern/FormatInfo.java
@@ -45,7 +45,7 @@ public class FormatInfo {
* a FormatInfo.
*
* @param str A String to convert into a FormatInfo object
- * @return A newly created and approprioately initialized FormatInfo object.
+ * @return A newly created and appropriately initialized FormatInfo object.
* @throws IllegalArgumentException
*/
public static FormatInfo valueOf(String str) throws IllegalArgumentException {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/pattern/PostCompileProcessor.java b/logback-core/src/main/java/ch/qos/logback/core/pattern/PostCompileProcessor.java
index a61ca2e..128a3df 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/pattern/PostCompileProcessor.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/pattern/PostCompileProcessor.java
@@ -17,7 +17,7 @@ package ch.qos.logback.core.pattern;
/**
* Implements this to perform post compile processing for a PatternLayout.
*
- * For example, PatternLayot in the classic module should add a converter for
+ * For example, PatternLayout in the classic module should add a converter for
* exception handling (otherwise exceptions would not be printed).
*
* @author Ceki Gulcu
diff --git a/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareBase.java b/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareBase.java
index 874a03d..b0814ac 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareBase.java
@@ -24,7 +24,7 @@ import ch.qos.logback.core.status.WarnStatus;
* A helper class that implements ContextAware methods. A class can implement
* the ContextAware interface by deriving from this class.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class ContextAwareBase implements ContextAware {
private int noContextWarning = 0;
diff --git a/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareImpl.java b/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareImpl.java
index 9512dd1..91d3e93 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareImpl.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/spi/ContextAwareImpl.java
@@ -25,7 +25,7 @@ import ch.qos.logback.core.status.WarnStatus;
* A helper class that implements ContextAware methods. Use this class to
* implement the ContextAware interface by composition.
*
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class ContextAwareImpl implements ContextAware {
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/FileOpener.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/FileOpener.java
index 66f8313..6e91093 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/FileOpener.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/FileOpener.java
@@ -20,7 +20,7 @@ import java.io.InputStream;
/**
* Keep the file "output/test.log open for 10 seconds so that we can test
* RollingFileAppender's ability to roll file open by another process.
- * @author Ceki Gülcü
+ * @author Ceki Gülcü
*/
public class FileOpener {
public static void main(String[] args) throws Exception {
diff --git a/logback-site/src/site/pages/access.html b/logback-site/src/site/pages/access.html
index 8fd3720..057d8c9 100644
--- a/logback-site/src/site/pages/access.html
+++ b/logback-site/src/site/pages/access.html
@@ -42,7 +42,7 @@
and can thus provide much of the functionality of logback-classic
but in the scope of HTPP-access logging. </p>
- <p>It should be noted that while loback-access requires
+ <p>It should be noted that while logback-access requires
logback-core, it is independent of logback-classic as well as
slf4j. Just as importantly, logback-access artifact must be
installed at the container level, not at web-applcation level. It
diff --git a/logback-site/src/site/pages/codes.html b/logback-site/src/site/pages/codes.html
index 88894ac..29537e5 100644
--- a/logback-site/src/site/pages/codes.html
+++ b/logback-site/src/site/pages/codes.html
@@ -136,7 +136,7 @@
which are only possible using encoders. <b>During a transition
period, layouts passed as parameter will be automatically wrapped by
an encoder so that configuration files in the old format (using a
- layout instead of encoder) will continue to work unmodifed.</b>
+ layout instead of encoder) will continue to work unmodified.</b>
</p>
<hr/>
@@ -433,7 +433,7 @@
<p>Given that <code>FixedWindowRollingPolicy</code> performs
multiple file rename operations during roll over, and that these
operations cannot be guaranteed to be safe in a multi-JVM context,
- prudent mode is not allowed in conjuction with a
+ prudent mode is not allowed in conjunction with a
<code>FixedWindowRollingPolicy</code>.
</p>
diff --git a/logback-site/src/site/pages/consolePlugin.html b/logback-site/src/site/pages/consolePlugin.html
index aa66d1b..750dff4 100644
--- a/logback-site/src/site/pages/consolePlugin.html
+++ b/logback-site/src/site/pages/consolePlugin.html
@@ -233,7 +233,7 @@
<p>
The logback plugin lets you filter logging events when they are
received. It uses the powerful <code>EvaluatorFilter</code> objects
- that are available in logback. For detailled information about these filters, you might want
+ that are available in logback. For detailed information about these filters, you might want
to check the <a href="manual/filters.html">corresponding documentation</a>
in the logback manual. In this document, we will only
cover some basic points, enough to get you started using the filtering
diff --git a/logback-site/src/site/pages/demo.html b/logback-site/src/site/pages/demo.html
index 90d7de3..89cec1c 100644
--- a/logback-site/src/site/pages/demo.html
+++ b/logback-site/src/site/pages/demo.html
@@ -34,7 +34,7 @@
<p class="source">git clone http://git.qos.ch/logback-demo/ logback-demo</p>
- <p>This will retreive a copy of the logback demonstration
+ <p>This will retrieve a copy of the logback demonstration
web-application to a directory called <em>logback-demo</em>. The
logback demo can be packaged as a <em>war</em> file and deployed
to an application server. We strongly recommend the use of <a
@@ -74,7 +74,7 @@
<p>We highly encourage you to study the <em>logback.xml</em>
configuration file located under the <em>src/main/resources/</em>
folder. You might want to keep this file open in an editor window,
- since we will modify its contents thoughout the demo.
+ since we will modify its contents throughout the demo.
</p>
<p>Let us now visit the <em>ViewStatii</em> page, via the navigation
@@ -170,7 +170,7 @@
behaviour once the expression matched (evaluated to true).
</p>
- <p>After a restart, the <em>Vew logs</em> page will shows the
+ <p>After a restart, the <em>View logs</em> page will shows the
<em>Howdydy-diddly-ho</em> logs, but only for the first 20
seconds. If you wish to see new logging events to be shown on the
"View logs" page, then visit the "Prime number" page.
diff --git a/logback-site/src/site/pages/documentation.html b/logback-site/src/site/pages/documentation.html
index 5c07e09..cb27a5f 100644
--- a/logback-site/src/site/pages/documentation.html
+++ b/logback-site/src/site/pages/documentation.html
@@ -22,7 +22,7 @@
<h2>Logback documentation</h2>
- <p>Below is a list of logback-related documentaiton currently
+ <p>Below is a list of logback-related documentation currently
available.</p>
<ul>
diff --git a/logback-site/src/site/pages/faq.html b/logback-site/src/site/pages/faq.html
index 195f83e..aa80d9c 100644
--- a/logback-site/src/site/pages/faq.html
+++ b/logback-site/src/site/pages/faq.html
@@ -70,7 +70,7 @@
<li>
<a href="#setup_jetty">How can Jetty be instructed to use
- logback-classic as its logging implementataion?
+ logback-classic as its logging implementation?
</a>
</li>
</ol>
@@ -187,7 +187,7 @@
<dd>
<p>Yes. A logback logger <em>is</em> an SLF4J logger and SLF4J
loggers are serializable. This means that an object
- referencing a logger will be alble to log after its
+ referencing a logger will be able to log after its
deserialization.
</p>
@@ -264,7 +264,7 @@
<dd>
<p>Logback does not allow logging to be disabled from the command
line. However, if the configuration file allows it, you can
- set the level of logers on the command line via a Java
+ set the level of loggers on the command line via a Java
system property. Here is such a configuration file.</p>
<p class="source"><configuration>
diff --git a/logback-site/src/site/pages/manual/appenders.html b/logback-site/src/site/pages/manual/appenders.html
index e7d6d4a..f384485 100644
--- a/logback-site/src/site/pages/manual/appenders.html
+++ b/logback-site/src/site/pages/manual/appenders.html
@@ -993,7 +993,7 @@ public interface RollingPolicy extends LifeCycle {
class="option">fileNamePattern</span>. By leaving the <span
class="option">file</span> option unset you can avoid file <a
href="../codes.html#renamingError">renaming errors</a> which occur
- while there exist external file handles refrencing log files during
+ while there exist external file handles referencing log files during
roll over.
</p>
@@ -2355,7 +2355,7 @@ logger.error(<b>notifyAdmin</b>,
href="#smtpDiscriminator">SMTPAppender with
MDCDiscriminator</a></h3>
- <p>As mentioned earlier, by specifiying a discriminator other than
+ <p>As mentioned earlier, by specifying a discriminator other than
the default one, <code>SMTPAppender</code> will generate email
messages containing events pertaining to a particular user, user
session or client IP address, depending on the specified discriminator.
@@ -2406,7 +2406,7 @@ logger.error(<b>notifyAdmin</b>,
<h4><a name= "bufferManagement" href="#bufferManagement">On buffer
management in very busy systems</a></h4>
- <p>Internally, each distinct value returned by the disciminator
+ <p>Internally, each distinct value returned by the discriminator
will cause the creation of a new cyclic buffer. However, at most
<span class="option">maxNumberOfBuffers</span> (by default 64)
will be maintained. Whenever the number of buffers rises above
@@ -2437,7 +2437,7 @@ logger.error(<b>notifyAdmin</b>,
512 or 1024 without risking running out of memory.
</p>
- <p>Thuse reare three distinct but complementary mechanisms working
+ <p>There are three distinct but complementary mechanisms working
together to manage cyclic buffers. They ensure that only relevant
buffers are kept alive at any given moment, even in very busy
systems.</p>
@@ -3576,7 +3576,7 @@ public class CountingConsoleAppender extends AppenderBase<ILoggingEvent> {
class="option">defaultValue</span> property is used.
</p>
- <p>The desginated AccessEvent field can be one of COOKIE,
+ <p>The designated AccessEvent field can be one of COOKIE,
REQUEST_ATTRIBUTE, SESSION_ATTRIBUTE, REMOTE_ADDRESS, LOCAL_PORT,
REQUEST_URI. Note that the first three fields require that the
<span class="option">AdditionalKey</span> property also be
@@ -3609,7 +3609,7 @@ public class CountingConsoleAppender extends AppenderBase<ILoggingEvent> {
<p>In the above configuration file, a <code>SiftingAppender</code>
nests <code>FileAppender</code> instances. The key "id" is
- designated as a variable which will be availabe to the nested
+ designated as a variable which will be available to the nested
<code>FileAppender</code> instances. The default discriminator,
namely <code>AccessEventDiscriminator</code>, will search for a
"username" session attribute in each <code>AccessEvent</code>. If
diff --git a/logback-site/src/site/pages/manual/architecture.html b/logback-site/src/site/pages/manual/architecture.html
index 9a3f956..7bfa4f5 100644
--- a/logback-site/src/site/pages/manual/architecture.html
+++ b/logback-site/src/site/pages/manual/architecture.html
@@ -732,7 +732,7 @@ logger.debug("The new entry is {}.", entry);</pre>
<pre class="prettyprint source">logger.debug("The new entry is {}. It replaces {}.", entry, oldEntry);</pre>
<p>If three or more arguments need to be passed, an
- <code>Object[]</code> variant is also availalble. For example, you
+ <code>Object[]</code> variant is also available. For example, you
can write:
</p>
diff --git a/logback-site/src/site/pages/manual/configuration.html b/logback-site/src/site/pages/manual/configuration.html
index 38a8de0..f3ae3d0 100644
--- a/logback-site/src/site/pages/manual/configuration.html
+++ b/logback-site/src/site/pages/manual/configuration.html
@@ -381,7 +381,7 @@ public class Foo {
<p>It is strongly recommended to register a status listener,
e.g. <code>OnConsoleStatusListener</code>, so that problems
- occuring during the lifetime of your application, well after
+ occurring during the lifetime of your application, well after
logback is initialized, can be reported. See the section on <a
href="#statusListener">status listeners</a> further below.</p>
@@ -1405,7 +1405,7 @@ public class MyApp3 {
<h4>Nested variable substitution</h4>
- <p>Nested variable subsitution is also supported. By nested, we
+ <p>Nested variable substitution is also supported. By nested, we
mean that the value definition of a variable contains references to
other variables. Suppose you wish to use variables to specify not
only the destination directory but also the file name, and combine
@@ -1755,7 +1755,7 @@ fileName=myApp.log
....
</configuration></pre>
- <p>Setting the <span class="option">resetJUL</span> propery of
+ <p>Setting the <span class="option">resetJUL</span> property of
LevelChangePropagator will reset all previous level configurations
of all j.u.l. loggers. However, previously installed handlers will be
left untouched.</p>
diff --git a/logback-site/src/site/pages/manual/filters.html b/logback-site/src/site/pages/manual/filters.html
index 0d9e9dd..28001b3 100644
--- a/logback-site/src/site/pages/manual/filters.html
+++ b/logback-site/src/site/pages/manual/filters.html
@@ -126,8 +126,8 @@ public class SampleFilter extends Filter>ILoggingEvent> {
}
}</pre>
- <p>The configutation files shown next attaches a
- <code>SampleFilter</code> to a <code>ConsoleAppener</code>.
+ <p>The configuration files shown next attaches a
+ <code>SampleFilter</code> to a <code>ConsoleAppender</code>.
</p>
<em>Example: SampleFilter configuration
@@ -151,7 +151,7 @@ public class SampleFilter extends Filter>ILoggingEvent> {
</configuration></pre>
<p>With the help of Joran, logback's configuration framework,
- specifying properties or sub-componenets to filters is also
+ specifying properties or sub-components to filters is also
easy. After adding the corresponding setter method in the filter
class, specify the value of the property in an xml element named
after the property, nesting it within a <code><filter></code>
@@ -282,7 +282,7 @@ public class SampleFilter extends Filter>ILoggingEvent> {
filtering. <code>GEventEvaluator</code> requires the Groovy
runtime. Please see the <a
href="../setup.html#gEventEvaluator">corresponding section</a> of
- the setup document on adding the Groovy runtinme to your class
+ the setup document on adding the Groovy runtime to your class
path.
</p>
@@ -384,7 +384,7 @@ public class SampleFilter extends Filter>ILoggingEvent> {
<p>Evaluation expressions are compiled on-the-fly during the
interpretation of the configuration file. As a user, you do not
need to worry about the actual plumbing. However, it is your
- reponsibility to ensure that the Java language expression returns
+ responsibility to ensure that the Java language expression returns
a boolean, i.e. that it evaluates to true or false. </p>
@@ -422,7 +422,7 @@ public class SampleFilter extends Filter>ILoggingEvent> {
message.</td> </tr>
<tr>
- <td>formatedMessage</td>
+ <td>formattedMessage</td>
<td><code>String</code></td>
<td>The formatted message in the logging request. For some
logger <em>l</em>, when you write l.info("Hello {}", name);
@@ -501,7 +501,7 @@ public class SampleFilter extends Filter>ILoggingEvent> {
value of the "throwable" variable will be null. Unfortunately,
"throwable" does not survive serialization. Thus, on remote
systems, its value will always be null. For location
- independent expresisons, use the <code>throwableProxy</code>
+ independent expressions, use the <code>throwableProxy</code>
variable described next.
</td>
</tr>
@@ -572,7 +572,7 @@ public class SampleFilter extends Filter>ILoggingEvent> {
<p>Given that the <span class="option">OnMismatch</span> property is
set to NEUTRAL and the <span class="option">OnMatch</span>
- property set to DENY, this evalutor filter will drop all logging
+ property set to DENY, this evaluator filter will drop all logging
events whose message contains the string "billing".
</p>
@@ -1113,7 +1113,7 @@ logger.debug("Hello {}.", name1);</pre>
href="../xref/ch/qos/logback/access/boolex/JaninoEventEvaluator.html">JaninoEventEvaluator</a>.
It takes arbitrary Java language boolean expressions as the
evaluation criteria. We refer to such Java language blocks as
- "<em>evaluation expresisons</em>". Evaluation expressions enable
+ "<em>evaluation expressions</em>". Evaluation expressions enable
great flexibility in event
filtering. <code>JaninoEventEvaluator</code> requires the <a
href="http://docs.codehaus.org/display/JANINO/Home">Janino
@@ -1125,7 +1125,7 @@ logger.debug("Hello {}.", name1);</pre>
<p>Evaluation expressions are compiled on-the-fly during the
interpretation of the configuration file. As a user, you do not
need to worry about the actual plumbing. However, it is your
- reponsibility to ensure that the Java language expression returns
+ responsibility to ensure that the Java language expression returns
a boolean, i.e. that it evaluates to true or false. </p>
diff --git a/logback-site/src/site/pages/manual/groovy.html b/logback-site/src/site/pages/manual/groovy.html
index 7dd8513..a3443c6 100644
--- a/logback-site/src/site/pages/manual/groovy.html
+++ b/logback-site/src/site/pages/manual/groovy.html
@@ -70,7 +70,7 @@
programs. And since Groovy is a super-set of Java, whatever
configuration actions you can perform in Java, you can do the same
within a <em>logback.groovy</em> file. However, since configuring
- logback progammatically using Java syntax can be cumbersome, we
+ logback programmatically using Java syntax can be cumbersome, we
added a few logback-specific extensions to make your life
easier. We try hard to limit the number of logback-specific
syntactic extensions to an absolute minimum. If you are already
diff --git a/logback-site/src/site/pages/manual/introduction.html b/logback-site/src/site/pages/manual/introduction.html
index 287fb5a..2a0faba 100644
--- a/logback-site/src/site/pages/manual/introduction.html
+++ b/logback-site/src/site/pages/manual/introduction.html
@@ -137,7 +137,7 @@ public class HelloWorld1 {
<p class="source">20:49:07.962 [main] DEBUG chapters.introduction.HelloWorld1 - Hello world.</p>
<p>Logback can report information about its internal state using a
- built-in status system. Important events occuring during logback's
+ built-in status system. Important events occurring during logback's
lifetime can be accessed through a component called
<code>StatusManager</code>. For the time being, let us instruct
logback to print its internal state by invoking the static
diff --git a/logback-site/src/site/pages/manual/layouts.html b/logback-site/src/site/pages/manual/layouts.html
index 95de04c..6d55557 100644
--- a/logback-site/src/site/pages/manual/layouts.html
+++ b/logback-site/src/site/pages/manual/layouts.html
@@ -60,7 +60,7 @@
String getContentType();
}</pre>
- <p>This interface is rather simple and yet is sufficent for many
+ <p>This interface is rather simple and yet is sufficient for many
formatting needs. The Texan developer from Texas, whom you might
know from Joseph Heller's <em>Catch-22</em>, might exclaim: it
just takes five methods to implement a layout!!?
@@ -919,7 +919,7 @@ Caller+2 at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre>
<p>Logback goes to great lengths to ensure that the class
packaging information it displays is correct, even in
- arbirarily complex class loader hierarchies. However, when
+ arbitrarily complex class loader hierarchies. However, when
it is unable to guarantee the absolute correctness of the
information, then it will prefix the data with a tilde, i.e.
the '~' character. Thus, it is theoretically possible for
@@ -950,7 +950,7 @@ Caller+2 at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre>
</td>
<td>
- <p>Altough it <em>pretends</em> to handle stack trace data,
+ <p>Although it <em>pretends</em> to handle stack trace data,
this conversion word does not output any data, thus,
effectively ignoring exceptions.
</p>
@@ -1338,7 +1338,7 @@ Caller+2 at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre>
are presented in a <a
href="filters.html#evalutatorFilter">dedicated section of the
chapter on filters</a> which you MUST read if you want to use
- evaluators in any meaninful way. Also note that the examples below
+ evaluators in any meaningful way. Also note that the examples below
are implicitly based on <code>JaninoEventEvaluator</code> which
requires the <a
href="http://docs.codehaus.org/display/JANINO/Home">Janino
@@ -1425,7 +1425,7 @@ public class CallerEvaluatorExample {
<p>The above application does nothing particularly fancy. Five
logging requests are issued, the third one emitting the message
- "who calls theee?"
+ "who calls thee?"
</p>
<p>The command</p>
@@ -1464,7 +1464,7 @@ Caller+0 at chapters.layouts.CallerEvaluatorExample.main(CallerEvaluatorExampl
<p>Let us consider at a different situation. When exceptions are
included in a logging request, their stack trace is also
- output. However, one might want to supress the stack trace for
+ output. However, one might want to suppress the stack trace for
some specific exceptions.
</p>
@@ -1521,7 +1521,7 @@ public class ExceptionEvaluatorExample {
<p>In the next configuration file, the evaluation expression
matches events containing a throwable of type
<code>chapters.layouts.TextException</code>, precisely the type of
- exceptions we wish to supress.
+ exceptions we wish to suppress.
</p>
<em>
@@ -1764,7 +1764,7 @@ public class MySampleConverter extends ClassicConverter {
<p>The <a
href="../xref/chapters/layouts/TrivialMain.html">TrivialMain</a>
application logs a few messages finishing with an exception. The
- commmand:</p>
+ command:</p>
<p class="source">java chapters.layouts.TrivialMain src/main/java/chapters/layouts/htmlLayoutConfig1.xml</p>
@@ -1895,7 +1895,7 @@ public class MySampleConverter extends ClassicConverter {
<code>PatternLayout</code></a> in logback-access can be configured
in much the same way as its classic counterpart. However it
features additional conversion specifiers suited for logging
- particular bits of information availalbe only in HTTP servlet
+ particular bits of information available only in HTTP servlet
requests and HTTP servlet responses.
</p>
@@ -2118,7 +2118,7 @@ public class MySampleConverter extends ClassicConverter {
<code>HttpServletResponse</code> by a <a
href="../xref/ch/qos/logback/access/servlet/TeeHttpServletResponse.html">
<code>TeeHttpServletResponse</code></a>. The latter object
- allows access to the requet's <code>InputStream</code>
+ allows access to the request's <code>InputStream</code>
multiple times without any loss of data.
</p>
</td>
@@ -2127,7 +2127,7 @@ public class MySampleConverter extends ClassicConverter {
<td align="center"><b>fullResponse</b></td>
<td>
<p>This conversion word takes all the available data
- associated with the response, inclusing all headers of the
+ associated with the response, including all headers of the
response and response contents.
</p>
</td>
@@ -2190,7 +2190,7 @@ public class MySampleConverter extends ClassicConverter {
<p>What can be better than a real world example? Our own log4j
properties for logback <a
href="http://logback.qos.ch/translator/">translator</a> makes use
- of logback-access to demonstrate live ouput from
+ of logback-access to demonstrate live output from
<code>RollingFileAppender</code> with <code>HTMLLayout</code>.</p>
diff --git a/logback-site/src/site/pages/manual/mdc.html b/logback-site/src/site/pages/manual/mdc.html
index 5522b3d..2977d96 100644
--- a/logback-site/src/site/pages/manual/mdc.html
+++ b/logback-site/src/site/pages/manual/mdc.html
@@ -318,7 +318,7 @@ public class NumberCruncherServer extends UnicastRemoteObject
}
// Placing artificial delays in tight loops will also lead to
- // sub-optimal resuts. :-)
+ // sub-optimal results. :-)
delay(100);
}
@@ -730,7 +730,7 @@ public class UserServletFilter implements Filter {
<p>Once the filter is installed, values corresponding to each MDC
key will be output by the %X <a
- href="layouts.html#conversionWord">conversion word</a> acoording to
+ href="layouts.html#conversionWord">conversion word</a> according to
the key passes as first option. For example, to print the remote
host followed by the request URI on one line, the date followed by
the message on the next, you would set <code>PatternLayout</code>'s
diff --git a/logback-site/src/site/pages/manual/migrationFromLog4j.html b/logback-site/src/site/pages/manual/migrationFromLog4j.html
index 15e6727..22bcda5 100644
--- a/logback-site/src/site/pages/manual/migrationFromLog4j.html
+++ b/logback-site/src/site/pages/manual/migrationFromLog4j.html
@@ -124,9 +124,9 @@ public class TrivialLogbackLayout extends <b>LayoutBase<ILoggingEvent></b> {
<code>activateOptions</code>() method invoked by log4j
configurators, that is <code>PropertyConfigurator</code> or
<code>DOMConfigurator</code> just after all the options of the
- layout have been set. Thus, the layout will have an oppurtunity to
+ layout have been set. Thus, the layout will have an opportunity to
check that its options are coherent and if so, proceed to fully
- intialize itself.</p>
+ initialize itself.</p>
<p>In logback-classic, layouts must implement the <a
diff --git a/logback-site/src/site/pages/manual/onJoran.html b/logback-site/src/site/pages/manual/onJoran.html
index 2c6d5be..7a78fbe 100644
--- a/logback-site/src/site/pages/manual/onJoran.html
+++ b/logback-site/src/site/pages/manual/onJoran.html
@@ -40,7 +40,7 @@
</p>
<p>Joran is actually a generic configuration system which can be
- used independently of logging. To emphaises this point, we should
+ used independently of logging. To emphasize this point, we should
mention that the logback-core module does not have a notion of
loggers. In that spirit, most of the examples in this chapter have
nothing to do with loggers, appenders or layouts.
@@ -131,7 +131,7 @@
migrated to SAX in order to benefit from element location
information, available only with the SAX API. Location information
allows Joran to display the exact line and column number where an
- error occured, which comes in very handy in indentifying parsing
+ error occurred, which comes in very handy in identifying parsing
problems.
</p>
@@ -225,7 +225,7 @@ public abstract class Action {
processes SAX events. </p>
<p>When several rules match the current pattern, then exact
- matches override suffix matches, and suffix matches overide prefix
+ matches override suffix matches, and suffix matches override prefix
matches. For exact details of the implementation, please see the <a
href="../xref/ch/qos/logback/core/joran/spi/SimpleRuleStore.html">SimpleRuleStore</a>
class.
@@ -294,7 +294,7 @@ public abstract class Action {
<p class="command">java chapters.onJoran.helloWorld.HelloWorld src/main/java/chapters/onJoran/helloWorld/hello.xml</p>
- <p>You are highly encourared to poke about in this example, by adding
+ <p>You are highly encouraged to poke about in this example, by adding
new rules on the rule store, modifying the XML document
(hello.xml) and adding new actions.
</p>
diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html
index 928f35b..a4f41e6 100644
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@ -32,7 +32,7 @@
<p>Fixed <a
href="http://jira.qos.ch/browse/LBCLASSIC-254">LBCLASSIC-254</a>,
- a performace issue in <code>LogbackMDCAdapter</code> as reported
+ a performance issue in <code>LogbackMDCAdapter</code> as reported
by Michael Franz.</p>
<p>Given that events reference a snapshot of the current MDC map,
@@ -43,14 +43,14 @@
to fix LBCLASSIC-254</p>.
<p><code>ConfigurationWatchList</code> no longer emits an error
- message when it encouters a configuraton file placed in a jar
+ message when it encounters a configuration file placed in a jar
file, fixing <a
href="http://jira.qos.ch/browse/LBCLASSIC-246">LBCLASSIC-246</a>
as reported by Joern Huxhorn.
</p>
<p>Logback now emits a clearer error message in case a conversion
- pattern misses a closing parenthesis or if an openening
+ pattern misses a closing parenthesis or if an opening
parenthesis is misplaced. This fixes <a
href="http://jira.qos.ch/browse/LBCORE-193">LBCORE-193</a>
reported by B. K. Oxley.</p>
@@ -78,7 +78,7 @@
<p>In the <a
href="apidocs/ch/qos/logback/core/Context.html">Context</a>
interface, the previously misspelled property
- <code>bithTime</code> ia now renamed as
+ <code>bithTime</code> is now renamed as
<code>birthTime</code>. This is a backward-incompatible
change. All pre-existing references to "bithTime" property now
need to referenced as "birthTime".</p>
@@ -204,7 +204,7 @@
<p>As reported in <a
href="http://jira.qos.ch/browse/LBCORE-164">LBCORE-164</a>,
<code>SizeAndTimeBasedFNATP</code> would cause previous logging
- files with indexes over nine to be overwitten on application
+ files with indexes over nine to be overwritten on application
restart. This complex bug was reported and precisely diagnosed by
Dieter Mueller. He has also proposed a fix which was subsequently
adopted as is.</p>
@@ -218,7 +218,7 @@
null.</p>
<p>Fixed issue with <code>SizeAndTimeBasedFNATP</code> in presence
- of application stop/restart and non-null file proprety. This issue
+ of application stop/restart and non-null file property. This issue
was reported by Tom Liu in <a
href="http://jira.qos.ch/browse/LBCORE-131">LBCORE-131</a>.</p>
@@ -279,7 +279,7 @@
which processes boolean expression written in the Groovy language.
</p>
- <p>Fixed rollover problem occuring when the target directory was
+ <p>Fixed rollover problem occurring when the target directory was
missing as reported in <a
href="http://jira.qos.ch/browse/LBCORE-151">LBCORE-151</a> by
Torsten Juergeleit. A closely related problem was reported in <a
@@ -350,7 +350,7 @@
encoders. <b>During a transition period, layouts passed as
parameter will be automatically wrapped by an encoder so that
configuration files in the old format (using a layout instead of
- encoder) will continue to work unmodifed.</b>
+ encoder) will continue to work unmodified.</b>
</p>
</div>
@@ -422,7 +422,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>Request header names in AccessEvent (logback-access) are now
stored in a case insensitive way as specified in RFC 2616. This
prevents compatibility issues, in particular with recent versions
- of Tomcat whcih store request header names in lower-case.</p>
+ of Tomcat which store request header names in lower-case.</p>
<p>Fixed <a
@@ -517,10 +517,10 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
href="http://jira.qos.ch/browse/LBCLASSIC-165">LBCLASSIC-165</a>
and <a
href="http://jira.qos.ch/browse/LBCLASSIC-121">LBCLASSIC-121</a>
- by applying the relavant patches supplied by Hugues Malphettes.
+ by applying the relevant patches supplied by Hugues Malphettes.
</p>
- <p>Made the OSGi import declerations for Janino and javax optional
+ <p>Made the OSGi import declarations for Janino and javax optional
as proposed by David Varnes in <a
href="http://jira.qos.ch/browse/LBCORE-101">LBCORE-101</a>.</p>
@@ -565,7 +565,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>When a logger is named after an inner class, the '$' is used as
a separator, instead of the usual '.'. This fixes the level
- inheritence issue described in <a
+ inheritance issue described in <a
href="http://jira.qos.ch/browse/LBCLASSIC-102">LBCLASSIC-102</a>
and as reported by Joern Huxhorn.</p>
@@ -617,7 +617,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>The <code>TimeBasedTriggeringPolicy</code> has been heavily
- refactored. It is now possible to trigger rolling simultaenously
+ refactored. It is now possible to trigger rolling simultaneously
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>.
@@ -744,7 +744,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
and the other for <a
href="access.html#viewingStatusMessages">logback-access</a>.</p>
- <p>Added the <code>clear()</code> mthod to the
+ <p>Added the <code>clear()</code> method to the
<code>StatusManager</code> interface. After reconfiguration, it
may be desirable to clear the status list maintained by a
<code>StatusManager</code>. This change was requested by Alexis
@@ -917,7 +917,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<code>NullPointerException</code> would be thrown.
</p>
- <p>In reponse to <a
+ <p>In response to <a
href="http://jira.qos.ch/browse/LBCLASSIC-61">LBCLASSIC-61</a>, <a
href="http://jira.qos.ch/browse/LBCLASSIC-33">LBCLASSIC-33</a>, <a
href="http://jira.qos.ch/browse/LBCLASSIC-14">LBCLASSIC-24</a> and
@@ -928,7 +928,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>Fixed <a
href="http://jira.qos.ch/browse/LBGENERAL-22">LBGENERAL-22</a>. The
<a href="http://logback.qos.ch/translator/">log4j.properties
- translator</a> web-application has been significatnly refactored.
+ translator</a> web-application has been significantly refactored.
</p>
<p>Fixed improvement request <a
@@ -1002,7 +1002,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>Fixed <a
href="http://jira.qos.ch/browse/LBCLASSIC-77">LBCLASSIC-77</a>
- reported independenly by Gianni Doe, Yannick Haudry and Yossi Shaul.
+ reported independently by Gianni Doe, Yannick Haudry and Yossi Shaul.
The childValue() method of <code>CopyOnInheritThreadLocal</code>
class part of MDC code no longer throws a
<code>NullPointerException</code>.
@@ -1020,13 +1020,13 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>The LogbackValve in logback-access (ensuring integration with
Tomcat), will now systematically print its internal status upon
initialization, unless told to be quiet. This greatly helps
- troubleshooting the configration of logback-access under Tomcat.
+ troubleshooting the configuration of logback-access under Tomcat.
</p>
<p>Fixed <a href="http://bugzilla.qos.ch/show_bug.cgi?id=147">bug
- 147</a> which occured when the user inadvertently attempted to set
+ 147</a> which occurred when the user inadvertently attempted to set
the layout of a <code>SyslogAppender</code>. The code now actively
- prevents this. Documenation has been updated to reflect the change.
+ prevents this. Documentation has been updated to reflect the change.
</p>
<p>Fixed <a href="http://jira.qos.ch/browse/LBCLASSIC-56">bug
@@ -1038,7 +1038,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
href="http://svn.qos.ch/viewvc?view=rev&revision=1678">now
cleared</a> when the <code>reset</code>() method is called. This
problem was reported on May 1st, 2008, by Julia Hu on the logback
- developpers list.
+ developers list.
</p>
<!-- ========================== LB CORE ================== -->
@@ -1048,7 +1048,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
rollover, compression of large files would bring all logging to a
halt. In this latest release, the rolled over file is first renamed,
which is a relatively fast operation, and only then is the renamed
- file compressed asyncronously (in a separate thread).
+ file compressed asynchronously (in a separate thread).
</p>
<p>Fixed issue <a
@@ -1118,8 +1118,8 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>Fixed issue <a
href="http://jira.qos.ch/browse/LBCLASSIC-68">LBCLASSIC-68</a>
reported by Gili Tzabari. In environments where the TCCL (Thread
- Context Class Laoder) was not set, logback was unable to located its
- default configuraiton files. Logback now uses the class loader that
+ Context Class Loader) was not set, logback was unable to located its
+ default configuration files. Logback now uses the class loader that
loaded logback itself to locate its resources instead of the
TCCL. This approach is simpler and deemed to cover more
environments, i.e. more widely applicable.
@@ -1141,7 +1141,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
</p>
<p>Added a new TurboFilter called DynamicThresholdFilter which can
- filter events depending on MDC values based on a variery of criteria
+ filter events depending on MDC values based on a variety of criteria
such as company name, product or the end user. This filter was
contributed by Ralph Goers in <a
href="http://jira.qos.ch/browse/LBCLASSIC-53">LBCLASSIC-53</a>.
@@ -1160,8 +1160,8 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
64</a> and independently by Peter Huber.
</p>
- <p>Logback no longer includes retro-weaver generted jars for JDK
- 1.4. There seemes to be little interest in JDK 1.4 builds. Calling
+ <p>Logback no longer includes retro-weaver generated jars for JDK
+ 1.4. There seems to be little interest in JDK 1.4 builds. Calling
retro-weaver increases logback's build time by a few seconds each
time – seconds in which we can do more productive things.
</p>
@@ -1220,7 +1220,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>Fixed <a href="http://bugzilla.qos.ch/show_bug.cgi?id=52">bug
52</a> reported by Kenichi Masuko. The bug has been fixed on March
8th, 2007. Starting with this release, Joran will support the
- injection of any enum tpye, not just <code>FilterReply</code>.
+ injection of any enum type, not just <code>FilterReply</code>.
</p>
<hr width="80%" align="center" />
@@ -1330,7 +1330,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
automatic initialization, it makes better sense to first check for
<em>logback-test.xml</em> file and only if that fails, to check for
<em>logback.xml</em>. Maven2 will guarantee that the
- logback-test.xml file, if places undder test/resources will not be
+ logback-test.xml file, if places under test/resources will not be
included in the artifact it produces.
</p>
@@ -1349,7 +1349,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
</p>
<p>The logback team released today the first version of a plugin for
- Eclipse that allows developpers to visualize logs generated by a
+ Eclipse that allows developers to visualize logs generated by a
running application. It offers several nice features. Please check
the <a href="consolePlugin.html">console plugin-in guide</a> for
more details.
@@ -1490,7 +1490,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
<p>Version 0.7.1 of logback has been released.
</p>
- <p>This version contains more detailled information about logback
+ <p>This version contains more detailed information about logback
access module, and its JMX components. A <a
href="access.html">dedicated page</a> explains how to configure and
use logback access in Tomcat and Jetty, and access some of its
@@ -1544,7 +1544,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
configuration examples has been added.
</p>
- <p>Logback now uses continous integration in its development.
+ <p>Logback now uses continuous integration in its development.
</p>
<p>Tests have been improved, many new have been added. This release
@@ -1563,7 +1563,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
</p>
<p>As in the previous release, a major area of work is the
- documentation which is being continously improved.
+ documentation which is being continuously improved.
</p>
<hr width="80%" align="center" />
@@ -1584,7 +1584,7 @@ ALTER TABLE logging_event ADD arg3 VARCHAR(254);</pre>
explaining possible reasons for the error.
</p>
- <p>A joran documentation was added, with examples in the core
+ <p>Joran documentation was added, with examples in the core
module.
</p>
diff --git a/logback-site/src/site/pages/reasonsToSwitch.html b/logback-site/src/site/pages/reasonsToSwitch.html
index 3e7592b..e8db30b 100644
--- a/logback-site/src/site/pages/reasonsToSwitch.html
+++ b/logback-site/src/site/pages/reasonsToSwitch.html
@@ -220,7 +220,7 @@ java.lang.Exception: 99 is invalid
<p>From the above, you can recognize that the application is using
Struts version 1.2.9 and was deployed under jetty version
6.1.12. Thus, stack traces will quickly inform the reader about
- the classes invervening in the exception but also the package and
+ the classes intervening in the exception but also the package and
package versions they belong to. When your customers send you a
stack trace, as a developer you will no longer need to ask them
to send you information about the versions of packages they are
diff --git a/logback-site/src/site/pages/recipes/captureHttp.html b/logback-site/src/site/pages/recipes/captureHttp.html
index 9303230..35cd684 100644
--- a/logback-site/src/site/pages/recipes/captureHttp.html
+++ b/logback-site/src/site/pages/recipes/captureHttp.html
@@ -66,7 +66,7 @@
<p>The <code>TeeFilter</code>, as any other servlet filter,
needs to be declared in your web-application's <em>web.xml</em>
- file. Here is the decleration to add to your web-application's
+ file. Here is the declaration to add to your web-application's
<em>web.xml</em> file.
</p>
@@ -149,8 +149,8 @@ Set-Cookie: JSESSIONID=bgebt99ce9om;path=/logback-demo
<h3><a name="disabling" href="#disabling">Disabling
<code>TeeFilter</code> in the production environment</a></h3>
- <p>Due to its instrusive nature, <code>TeeFilter</code> can slow
- down performance. Moreover, altough we have fixed all currently
+ <p>Due to its intrusive nature, <code>TeeFilter</code> can slow
+ down performance. Moreover, although we have fixed all currently
known bugs, <code>TeeFilter</code> has broken otherwise
correctly behaving applications in the past. Thus, while
extremely useful during problem hunting, we do not recommend
@@ -178,7 +178,7 @@ Set-Cookie: JSESSIONID=bgebt99ce9om;path=/logback-demo
</init-param>
</filter> </pre>
- <p>If it is easier to exliclitly name the integration machines,
+ <p>If it is easier to explicitly name the integration machines,
you could list them in the includes list and omit the excludes
list.
</p>
@@ -190,12 +190,12 @@ Set-Cookie: JSESSIONID=bgebt99ce9om;path=/logback-demo
cluster. The cluster is located behind a load-balancer which
probes each member of the cluster once or twice a second to
check whether it is alive. Whenever a member becomes unavailable
- the load-blancer will immediately (well, after at most one
+ the load-balancer will immediately (well, after at most one
second) divert traffic from that member.
</p>
<p>While such a load-balancing strategy will ensure
- high-availability of your web-applicaiton, it will also
+ high-availability of your web-application, it will also
seriously pollute the access-logs with the contents of each
probe made by the load-balancer.
</p>
@@ -218,7 +218,7 @@ X-Powered-By: Servlet 2.4;
Cache-Control: no-cache
Pragma: No-cache </pre>
- <p>From the above, we can see that the load-blancer probes
+ <p>From the above, we can see that the load-balancer probes
employ the <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4">HTTP
HEAD method</a> instead of the usual GET or POST. We can also
diff --git a/logback-site/src/site/pages/recipes/emailPerTransaction.html b/logback-site/src/site/pages/recipes/emailPerTransaction.html
index a7ca756..28ceead 100644
--- a/logback-site/src/site/pages/recipes/emailPerTransaction.html
+++ b/logback-site/src/site/pages/recipes/emailPerTransaction.html
@@ -45,10 +45,10 @@
identify the host where a particular transaction was
executed</li>
<li>Carol does not (or does not wish to) have access to the
- hosts where Byscrit runs
+ hosts where Buscrit runs
</li>
<li>Buscrit is tested by multiple testers, e.g. Dave and Carol
- and others, simultanesouly so that it is hard to identify and
+ and others, simultaneously so that it is hard to identify and
track an individual transaction in the log files
</li>
</ol>
@@ -159,11 +159,11 @@ public class PrimeAction extends Action {
<h3>Transaction isolation</h3>
<p>While the previous configuration file will trigger an outgoing
- email message whenenver an event is marked with "SMTP_TRIGGER", the
+ email message whenever an event is marked with "SMTP_TRIGGER", the
contents of the message will contain events generated by different
- transactions. With a little effort, we can actually seperate events
+ transactions. With a little effort, we can actually separate events
belonging to different transactions so that the outgoing email
- triggeed at the end of the transaction contains logs from that
+ triggered at the end of the transaction contains logs from that
transaction and only that transaction.
</p>
@@ -178,7 +178,7 @@ MDC.put("txId", transactionId); </pre>
<p>In the <a
href="http://logback-demo.qos.ch/xref/ch/qos/logback/demo/UserServletFilter.html"><code>UserServletFilter</code></a>
- class, this is done by retreiving the id of the session and putting
+ class, this is done by retrieving the id of the session and putting
it into the MDC under the key "txId".</p>
@@ -248,7 +248,7 @@ MDC.put("txId", transactionId); </pre>
<span class="option">to</span> options adapted for my environment)
on localhost and then visiting the <a
href="http://localhost:8070/logback-demo/prime.jsp">Prime
- number</a> page to factoize the number 123, I received the
+ number</a> page to factorize the number 123, I received the
following email:
</p>
@@ -283,7 +283,7 @@ MDC.put("txId", transactionId); </pre>
</p>
<p>Upon a logging event marked as SMTP_TRIGGER, the following
- confugration file will trigger an email message addressed to the
+ configuration file will trigger an email message addressed to the
value of "%mdc{txEmail}" but only if it contains the string "+log".
</p>
@@ -325,7 +325,7 @@ MDC.put("txId", transactionId); </pre>
you can still use them within the evaluator but remove them in
the recipient address with the help of the <a
href="../manual/layouts.html#replace">%replace</a> conversion
- word. Here is the relevant configuraton snippet:</p>
+ word. Here is the relevant configuration snippet:</p>
<pre class="prettyprint source"><appender name="SMTP" class="ch.qos.logback.classic.net.SMTPAppender">
<to>%replace(%mdc{txEmail}){'\+log', ''}</to>
@@ -352,7 +352,7 @@ MDC.put("txId", transactionId); </pre>
and automatically discards buffers untouched for at least 30
minutes. While this approach will work nicely in a test
environment with few transactions, in a very busy production
- system, these buffer management mechanims will cause Carol to
+ system, these buffer management mechanisms will cause Carol to
receive <a
href="../manual/appenders.html#bufferManagement">truncated log
buffers</a>. </p>
@@ -391,7 +391,7 @@ public class PrimeAction extends Action {
<p>Not that at the end of each transaction the appropriate buffer
- is discarded, we can incrase the value of <span
+ is discarded, we can increase the value of <span
class="option">maxNumberOfBuffers</span> as shown in the next
configuration file..
</p>
diff --git a/logback-site/src/site/pages/support.html b/logback-site/src/site/pages/support.html
index 511f40e..1074acc 100644
--- a/logback-site/src/site/pages/support.html
+++ b/logback-site/src/site/pages/support.html
@@ -32,7 +32,7 @@
logback and <a href="http://cal10n.qos.ch/">cal10n</a> projects,
we can offer you timely and competent support. Choosing our
professional support service is a good way to leverage our
- expertise. Moreovoer, if you require custom development we are
+ expertise. Moreover, if you require custom development we are
likely to be of help.
</p>
-----------------------------------------------------------------------
Summary of changes:
.../ch/qos/logback/access/pattern/NAConverter.java | 2 +-
.../access/pattern/RequestURIConverter.java | 2 +-
.../access/pattern/RequestURLConverter.java | 2 +-
.../java/ch/qos/logback/classic/LoggerContext.java | 2 +-
.../java/ch/qos/logback/classic/db/package.html | 2 +-
.../logback/classic/net/SimpleSocketServer.java | 2 +-
.../ch/qos/logback/classic/net/SyslogAppender.java | 2 +-
.../classic/spi/LoggerContextAwareBase.java | 2 +-
.../ch/qos/logback/classic/spi/LoggingEvent.java | 4 +-
.../ch/qos/logback/classic/spi/LoggingEventVO.java | 2 +-
.../ch/qos/logback/classic/turbo/MDCFilter.java | 2 +-
.../qos/logback/classic/turbo/MatchingFilter.java | 2 +-
.../classic/util/ContextSelectorStaticBinder.java | 2 +-
.../logback/classic/net/mock/MockSyslogServer.java | 2 +-
.../logback/core/boolex/EvaluationException.java | 2 +-
.../main/java/ch/qos/logback/core/db/package.html | 2 +-
.../java/ch/qos/logback/core/filter/package.html | 2 +-
.../ch/qos/logback/core/helpers/Transform.java | 2 +-
.../ch/qos/logback/core/net/JMSAppenderBase.java | 2 +-
.../ch/qos/logback/core/net/SMTPAppenderBase.java | 4 +-
.../qos/logback/core/net/SocketAppenderBase.java | 2 +-
.../qos/logback/core/net/SyslogAppenderBase.java | 8 +-
.../ch/qos/logback/core/pattern/FormatInfo.java | 2 +-
.../logback/core/pattern/PostCompileProcessor.java | 2 +-
.../ch/qos/logback/core/spi/ContextAwareBase.java | 2 +-
.../ch/qos/logback/core/spi/ContextAwareImpl.java | 2 +-
.../ch/qos/logback/core/rolling/FileOpener.java | 2 +-
logback-site/src/site/pages/access.html | 2 +-
logback-site/src/site/pages/codes.html | 4 +-
logback-site/src/site/pages/consolePlugin.html | 2 +-
logback-site/src/site/pages/demo.html | 6 +-
logback-site/src/site/pages/documentation.html | 2 +-
logback-site/src/site/pages/faq.html | 6 +-
logback-site/src/site/pages/manual/appenders.html | 12 ++--
.../src/site/pages/manual/architecture.html | 2 +-
.../src/site/pages/manual/configuration.html | 6 +-
logback-site/src/site/pages/manual/filters.html | 20 +++---
logback-site/src/site/pages/manual/groovy.html | 2 +-
.../src/site/pages/manual/introduction.html | 2 +-
logback-site/src/site/pages/manual/layouts.html | 24 ++++----
logback-site/src/site/pages/manual/mdc.html | 4 +-
.../src/site/pages/manual/migrationFromLog4j.html | 4 +-
logback-site/src/site/pages/manual/onJoran.html | 8 +-
logback-site/src/site/pages/news.html | 68 ++++++++++----------
logback-site/src/site/pages/reasonsToSwitch.html | 2 +-
.../src/site/pages/recipes/captureHttp.html | 14 ++--
.../site/pages/recipes/emailPerTransaction.html | 22 +++---
logback-site/src/site/pages/support.html | 2 +-
48 files changed, 139 insertions(+), 139 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
1
0