Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
155 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
dropwizard-jetty/src/main/java/io/dropwizard/jetty/DropwizardRequestLayout.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
dropwizard-jetty/src/main/java/io/dropwizard/jetty/LogbackAccessRequestLayout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.dropwizard.jetty; | ||
|
||
import ch.qos.logback.access.PatternLayout; | ||
import ch.qos.logback.core.Context; | ||
|
||
/** | ||
* A base layout for Logback Access request logs. | ||
* <ul> | ||
* <li>Extends {@link PatternLayout}.</li> | ||
* <li>Disables pattern headers.</li> | ||
* </ul> | ||
*/ | ||
public class LogbackAccessRequestLayout extends PatternLayout { | ||
|
||
public LogbackAccessRequestLayout(Context context, String pattern) { | ||
setOutputPatternAsHeader(false); | ||
|
||
setPattern(pattern); | ||
setContext(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
dropwizard-jetty/src/test/java/io/dropwizard/jetty/LogbackAccessRequestLayoutTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.dropwizard.jetty; | ||
|
||
import ch.qos.logback.core.Context; | ||
import org.junit.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.mockito.Mockito.mock; | ||
|
||
public class LogbackAccessRequestLayoutTest { | ||
|
||
@Test | ||
public void outputPatternAsHeaderIsFalse() { | ||
final Context context = mock(Context.class); | ||
final String pattern = "pattern"; | ||
final LogbackAccessRequestLayout layout = new LogbackAccessRequestLayout(context, pattern); | ||
|
||
assertThat(layout.isOutputPatternAsHeader()).isFalse(); | ||
assertThat(layout.getContext()).isEqualTo(context); | ||
assertThat(layout.getPattern()).isEqualTo(pattern); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.