-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Dropwizard applications without logback
- Loading branch information
Showing
8 changed files
with
90 additions
and
23 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
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
22 changes: 22 additions & 0 deletions
22
dropwizard-logging/src/main/java/io/dropwizard/logging/ExternalLoggingFactory.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,22 @@ | ||
package io.dropwizard.logging; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
|
||
/** | ||
* A logging factory which does configure a logging infrastructure. | ||
* Useful when the users doesn't want to use the Dropwizard logging configuration abilities. | ||
*/ | ||
@JsonTypeName("external") | ||
public class ExternalLoggingFactory implements LoggingFactory { | ||
|
||
@Override | ||
public void configure(MetricRegistry metricRegistry, String name) { | ||
|
||
} | ||
|
||
@Override | ||
public void stop() { | ||
|
||
} | ||
} |
1 change: 1 addition & 0 deletions
1
dropwizard-logging/src/main/resources/META-INF/services/io.dropwizard.logging.LoggingFactory
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
io.dropwizard.logging.DefaultLoggingFactory | ||
io.dropwizard.logging.ExternalLoggingFactory |
33 changes: 33 additions & 0 deletions
33
...equest-logging/src/main/java/io/dropwizard/request/logging/ExternalRequestLogFactory.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,33 @@ | ||
package io.dropwizard.request.logging; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
import org.eclipse.jetty.server.RequestLog; | ||
import org.eclipse.jetty.server.Slf4jRequestLog; | ||
|
||
/** | ||
* A request log factory which writes request logs via Slf4j and doesn't configure | ||
* any logging infrastructure. | ||
* Useful when the user doesn't want to configure request logging via Dropwizard configuration. | ||
*/ | ||
@JsonTypeName("external") | ||
public class ExternalRequestLogFactory implements RequestLogFactory { | ||
|
||
private boolean enabled = true; | ||
|
||
@JsonProperty | ||
public void setEnabled(boolean enabled) { | ||
this.enabled = enabled; | ||
} | ||
|
||
@Override | ||
@JsonProperty | ||
public boolean isEnabled() { | ||
return enabled; | ||
} | ||
|
||
@Override | ||
public RequestLog build(String name) { | ||
return new Slf4jRequestLog(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ging/src/main/resources/META-INF/services/io.dropwizard.request.logging.RequestLogFactory
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
io.dropwizard.request.logging.LogbackAccessRequestLogFactory | ||
io.dropwizard.request.logging.old.LogbackClassicRequestLogFactory | ||
io.dropwizard.request.logging.ExternalRequestLogFactory |
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