Skip to content

Commit 63d0bb7

Browse files
committed
various edits
1 parent 7c7e029 commit 63d0bb7

4 files changed

Lines changed: 22 additions & 18 deletions

File tree

logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ public String getRequestContent() {
393393
}
394394
requestContent = buf.toString();
395395
} else {
396-
397-
// retreive the byte array placed by TeeFilter
396+
// retrieve the byte array placed by TeeFilter
398397
byte[] inputBuffer = (byte[]) httpRequest
399398
.getAttribute(AccessConstants.LB_INPUT_BUFFER);
400399

logback-examples/src/main/java/chapters/appenders/CountingConsoleAppender.java

100644100755
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public int getLimit() {
3838
@Override
3939
public void start() {
4040
if (this.encoder == null) {
41-
addError("No layout set for the appender named ["+ name +"].");
41+
addError("No encoder set for the appender named ["+ name +"].");
4242
return;
4343
}
4444

@@ -53,13 +53,13 @@ public void append(ILoggingEvent event) {
5353
if (counter >= limit) {
5454
return;
5555
}
56-
// output the events as formatted by our layout
56+
// output the events as formatted by the wrapped layout
5757
try {
5858
this.encoder.doEncode(event);
5959
} catch (IOException e) {
6060
}
6161

62-
// prepare for next event
62+
// prepare for next event
6363
counter++;
6464
}
6565

@@ -70,6 +70,4 @@ public PatternLayoutEncoder getEncoder() {
7070
public void setEncoder(PatternLayoutEncoder encoder) {
7171
this.encoder = encoder;
7272
}
73-
74-
7573
}

logback-site/src/site/pages/manual/appenders.html

100644100755
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,8 +3620,11 @@ <h3><a name="WriteYourOwnAppender"
36203620
<p>The <code>CountingConsoleAppender</code>, which we list next,
36213621
appends a limited number of incoming events on the console. It
36223622
shuts down after the limit is reached. It uses a
3623-
<code>Layout</code> to format the events and accepts a parameter.
3624-
Thus, a few more methods are needed.
3623+
<code>PatternLayoutEncoder</code> to format the events and accepts
3624+
a parameter named <code>limit</code>. Therefore, a few more
3625+
methods beyond <code>append(Object eventObject)</code> are
3626+
needed. As shown below, these parameters are handles
3627+
auto-magically by logback's various configuration mechanisms.
36253628
</p>
36263629

36273630
<em>Example 4.<span class="autoExec"/>:
@@ -3654,7 +3657,7 @@ <h3><a name="WriteYourOwnAppender"
36543657
@Override
36553658
public void start() {
36563659
if (this.encoder == null) {
3657-
addError("No layout set for the appender named ["+ name +"].");
3660+
addError("No encoder set for the appender named ["+ name +"].");
36583661
return;
36593662
}
36603663

@@ -3686,24 +3689,23 @@ <h3><a name="WriteYourOwnAppender"
36863689
public void setEncoder(PatternLayoutEncoder encoder) {
36873690
this.encoder = encoder;
36883691
}
3689-
3690-
36913692
}</pre>
36923693

36933694
<p>The <code>start()</code> method checks for the presence of a
3694-
<code>Layout</code>. In case the layout is not set, the appender
3695-
fails to start with an error message.
3695+
<code>PatternLayoutEncoder</code>. In case the encoder is not
3696+
set, the appender fails to start and emits an error message.
36963697
</p>
36973698

36983699
<p>This custom appender illustrates two points:</p>
36993700

37003701
<ul>
37013702

37023703
<li>All properties that follow the setter/getter JavaBeans
3703-
conventions are handled transparently. The <code>start()</code>
3704-
method, which is called automatically during logback
3705-
configuration, has the responsibility of verifying that the
3706-
various properties of the appender are coherent.
3704+
conventions are handled transparently by logback
3705+
configurators. The <code>start()</code> method, which is called
3706+
automatically during logback configuration, has the
3707+
responsibility of verifying that the various properties of the
3708+
appender are set and are coherent.
37073709
</li>
37083710

37093711
<li>The <code>AppenderBase.doAppend()</code> method invokes the

logback-site/src/site/pages/news.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ <h3>, 2013 - Release of version 1.0.11</h3>
5757
href="http://jira.qos.ch/browse/LOGBACK-805">LOGBACK-805</a>
5858
reported by Daris Cooper who also provided a corrective patch.</p>
5959

60+
<p>In logback-access, more correct determination of whether
61+
contents of an <code>HttpServletRequest</code> are URL encoded or
62+
not. This <a href="https://github.com/qos-ch/logback/pull/71">bug
63+
fix</a> was submitted by David Schneider.</p>
64+
6065
<hr width="80%" align="center" />
6166

6267
<h3>15th of March, 2013 - Release of version 1.0.10</h3>

0 commit comments

Comments
 (0)