Skip to content

Commit 973a2a0

Browse files
author
Marcus Linke
committed
Fixed missing http entity (json) logging
1 parent 218ab1e commit 973a2a0

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/main/java/com/github/dockerjava/core/SelectiveLoggingFilter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.io.IOException;
44
import java.util.Set;
5+
import java.util.logging.Logger;
56

67
import javax.ws.rs.client.ClientRequestContext;
78
import javax.ws.rs.core.HttpHeaders;
@@ -25,7 +26,11 @@ public class SelectiveLoggingFilter extends LoggingFilter {
2526
.add("application/tar")
2627
.build();
2728

28-
@Override
29+
public SelectiveLoggingFilter(Logger logger, boolean b) {
30+
super(logger, b);
31+
}
32+
33+
@Override
2934
public void filter(ClientRequestContext context) throws IOException {
3035
// Unless the content type is in the list of those we want to ellide, then just have
3136
// our super-class handle things.

src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.dockerjava.jaxrs;
22

33
import java.io.IOException;
4+
import java.util.logging.Logger;
45

56
import javax.ws.rs.client.Client;
67
import javax.ws.rs.client.ClientBuilder;
@@ -52,6 +53,9 @@ public class DockerCmdExecFactoryImpl implements DockerCmdExecFactory {
5253

5354
private WebTarget baseResource;
5455

56+
private static final Logger LOGGER = Logger.getLogger(DockerCmdExecFactoryImpl.class.getName());
57+
58+
5559
@Override
5660
public void init(DockerClientConfig dockerClientConfig) {
5761
Preconditions.checkNotNull(dockerClientConfig, "config was not specified");
@@ -62,9 +66,11 @@ public void init(DockerClientConfig dockerClientConfig) {
6266
clientConfig.register(JacksonJsonProvider.class);
6367

6468
if (dockerClientConfig.isLoggingFilterEnabled()) {
65-
clientConfig.register(SelectiveLoggingFilter.class);
69+
clientConfig.register(new SelectiveLoggingFilter(LOGGER, true));
6670
}
6771

72+
//clientConfig.register(new LoggingFilter(LOGGER, true));
73+
6874
if (dockerClientConfig.getReadTimeout() != null) {
6975
int readTimeout = dockerClientConfig.getReadTimeout();
7076
clientConfig.property(ClientProperties.READ_TIMEOUT, readTimeout);

0 commit comments

Comments
 (0)