[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch master updated. v_1.0.0-72-g1169a18
Gitbot
git-noreply at pixie.qos.ch
Tue Mar 6 22:18:14 CET 2012
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 1169a18f6aac21cbbc1f2e60dfb7b75b2a2399a0 (commit)
from 26a0a37ccb1107094b079154e1a2d0f8c41eb9b6 (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=1169a18f6aac21cbbc1f2e60dfb7b75b2a2399a0
http://github.com/ceki/logback/commit/1169a18f6aac21cbbc1f2e60dfb7b75b2a2399a0
commit 1169a18f6aac21cbbc1f2e60dfb7b75b2a2399a0
Author: Ceki Gulcu <ceki at qos.ch>
Date: Tue Mar 6 22:17:13 2012 +0100
Fix LBCLASSIC-316
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 fe57c1b..d9318d9 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
@@ -328,17 +328,20 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
sbuf.append(footer);
}
+ String subjectStr = "Undefined subject";
if (subjectLayout != null) {
- mimeMsg.setSubject(subjectLayout.doLayout(lastEventObject),
- charsetEncoding);
+ subjectStr = subjectLayout.doLayout(lastEventObject);
}
+ mimeMsg.setSubject(subjectStr, charsetEncoding);
List<InternetAddress> destinationAddresses = parseAddress(lastEventObject);
if (destinationAddresses.isEmpty()) {
addInfo("Empty destination address. Aborting email transmission");
return;
}
- mimeMsg.setRecipients(Message.RecipientType.TO, destinationAddresses.toArray(EMPTY_IA_ARRAY));
+
+ InternetAddress[] toAddressArray = destinationAddresses.toArray(EMPTY_IA_ARRAY);
+ mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
@@ -355,6 +358,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
mimeMsg.setSentDate(new Date());
Transport.send(mimeMsg);
+ addInfo("Sent out SMTP message \""+subjectStr+"\" to "+Arrays.toString(toAddressArray));
} catch (Exception e) {
addError("Error occurred while sending e-mail notification.", e);
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java b/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java
index 59d1033..c5a361a 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java
@@ -108,6 +108,12 @@ public class AppenderTrackerImpl<E> implements AppenderTracker<E> {
private boolean isEntryStale(Entry entry, long now) {
+ // stopped or improperly started appenders are considered stale
+ // see also http://jira.qos.ch/browse/LBCLASSIC-316
+ if(!entry.value.isStarted())
+ return true;
+
+ // unused appenders are also considered stale
return ((entry.timestamp + THRESHOLD) < now);
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/sift/Simulator.java b/logback-core/src/test/java/ch/qos/logback/core/sift/Simulator.java
index 745b865..b9168cb 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/sift/Simulator.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/sift/Simulator.java
@@ -116,6 +116,7 @@ public class Simulator {
Appender<Object> appender = appenderTracker.get(key, timestamp);
if (appender == null) {
appender = new NOPAppender<Object>();
+ appender.start();
appenderTracker.put(key, appender, timestamp);
}
appenderTracker.stopStaleAppenders(timestamp);
diff --git a/logback-site/src/site/pages/manual/appenders.html b/logback-site/src/site/pages/manual/appenders.html
index 18c46b2..56cf6f9 100644
--- a/logback-site/src/site/pages/manual/appenders.html
+++ b/logback-site/src/site/pages/manual/appenders.html
@@ -2462,7 +2462,7 @@ logger.error(<b>notifyAdmin</b>,
host, greatly facilitating problem diagnosis.
</p>
- <h4><a name= "bufferManagement" href="#bufferManagement">On buffer
+ <h4><a name= "bufferManagement" href="#bufferManagement">Buffer
management in very busy systems</a></h4>
<p>Internally, each distinct value returned by the discriminator
diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html
index 0a6ba3f..1dadd0d 100644
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@ -60,6 +60,12 @@
as reported by Chris Cheshire.
</p>
+ <p>SiftingAppender will consider stale and consequently remove
+ nested appenders which are closed or improperly started. This
+ caters for the use case described in <a
+ href="http://jira.qos.ch/browse/LBCLASSIC-316">LBCLASSIC-316</a>
+ by Guus Bloemsma.</p>
+
<p><code>RequestLogImpl</code> can now lookup for the
logback-access configuration file as a class path resource. This
feature was requested in <a
-----------------------------------------------------------------------
Summary of changes:
.../ch/qos/logback/core/net/SMTPAppenderBase.java | 10 +++++++---
.../qos/logback/core/sift/AppenderTrackerImpl.java | 6 ++++++
.../java/ch/qos/logback/core/sift/Simulator.java | 1 +
logback-site/src/site/pages/manual/appenders.html | 2 +-
logback-site/src/site/pages/news.html | 6 ++++++
5 files changed, 21 insertions(+), 4 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list