Skip to content

Commit

Permalink
Moving access request log configuration in to its own method to allow…
Browse files Browse the repository at this point in the history
… extension
  • Loading branch information
Jamie Furness committed Jun 3, 2014
1 parent f6bf439 commit 38bed20
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Expand Up @@ -14,8 +14,6 @@
package ch.qos.logback.access.jetty;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -43,7 +41,6 @@
import ch.qos.logback.core.spi.FilterAttachableImpl;
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.core.status.ErrorStatus;
import ch.qos.logback.core.status.WarnStatus;
import ch.qos.logback.core.util.OptionHelper;

/**
Expand Down Expand Up @@ -151,19 +148,23 @@ private void addError(String msg) {
}

public void start() {
URL configURL = getConfigurationFileURL();
if (configURL != null) {
runJoranOnFile(configURL);
} else {
addError("Could not find configuration file for logback-access");
}
configure();
if (!isQuiet()) {
StatusPrinter.print(getStatusManager());
}
started = true;
}

URL getConfigurationFileURL() {
protected void configure() {
URL configURL = getConfigurationFileURL();
if (configURL != null) {
runJoranOnFile(configURL);
} else {
addError("Could not find configuration file for logback-access");
}
}

protected URL getConfigurationFileURL() {
if (fileName != null) {
addInfo("Will use configuration file [" + fileName + "]");
File file = new File(fileName);
Expand Down Expand Up @@ -266,7 +267,6 @@ public boolean isAttached(Appender<IAccessEvent> appender) {

public void detachAndStopAllAppenders() {
aai.detachAndStopAllAppenders();

}

public boolean detachAppender(Appender<IAccessEvent> appender) {
Expand Down
4 changes: 4 additions & 0 deletions logback-site/src/site/pages/news.html
Expand Up @@ -31,6 +31,10 @@ <h2>Logback News</h2>

<h3>Version 1.1.3</h3>

<p><code>RequestLogImpl</code> now has an overridable <code>configure</code>
method to allow extending implementations to configure it via methods
other than the <code>logback-access.xml</code> file.</p>

<div class="breaking">
<h4>All logback modules now require JDK 1.6 instead of
previously JDK 1.5. This change was put to consultation on the
Expand Down

0 comments on commit 38bed20

Please sign in to comment.