File tree 9 files changed +42
-34
lines changed
java/io/kubernetes/client/util
9 files changed +42
-34
lines changed Original file line number Diff line number Diff line change 47
47
<version >22.0</version >
48
48
</dependency >
49
49
<dependency >
50
- <groupId >log4j</groupId >
51
- <artifactId >log4j</artifactId >
52
- <version >1.2.17</version >
50
+ <groupId >org.slf4j</groupId >
51
+ <artifactId >slf4j-api</artifactId >
52
+ <version >1.7.25</version >
53
+ </dependency >
54
+ <dependency >
55
+ <groupId >ch.qos.logback</groupId >
56
+ <artifactId >logback-classic</artifactId >
57
+ <version >1.2.3</version >
53
58
</dependency >
54
59
<!-- test dependencies -->
55
60
<dependency >
92
97
<artifactId >maven-surefire-plugin</artifactId >
93
98
<version >2.12</version >
94
99
<configuration >
95
- <systemProperties >
96
- <property >
97
- <name >loggerPath</name >
98
- <value >conf/log4j.properties</value >
99
- </property >
100
- </systemProperties >
101
100
<argLine >-Xms512m -Xmx1500m</argLine >
102
101
<parallel >methods</parallel >
103
102
<forkMode >pertest</forkMode >
Original file line number Diff line number Diff line change 32
32
import java .nio .charset .Charset ;
33
33
import java .nio .file .Files ;
34
34
import java .nio .file .Paths ;
35
- import org .apache .log4j .Logger ;
35
+ import org .slf4j .Logger ;
36
+ import org .slf4j .LoggerFactory ;
36
37
37
38
/** A Builder which allows the construction of {@link ApiClient}s in a fluent fashion. */
38
39
public class ClientBuilder {
39
-
40
- private static final Logger log = Logger .getLogger (ClientBuilder .class );
40
+ private static final Logger log = LoggerFactory .getLogger (ClientBuilder .class );
41
41
42
42
private String basePath = Config .DEFAULT_FALLBACK_HOST ;
43
43
private byte [] caCertBytes = null ;
Original file line number Diff line number Diff line change 20
20
import java .io .InputStream ;
21
21
import java .io .InputStreamReader ;
22
22
import java .io .Reader ;
23
- import org .apache .log4j .Logger ;
23
+ import org .slf4j .Logger ;
24
+ import org .slf4j .LoggerFactory ;
24
25
25
26
public class Config {
27
+ private static final Logger log = LoggerFactory .getLogger (Config .class );
28
+
26
29
public static final String SERVICEACCOUNT_ROOT = "/var/run/secrets/kubernetes.io/serviceaccount" ;
27
30
public static final String SERVICEACCOUNT_CA_PATH = SERVICEACCOUNT_ROOT + "/ca.crt" ;
28
31
public static final String SERVICEACCOUNT_TOKEN_PATH = SERVICEACCOUNT_ROOT + "/token" ;
@@ -32,8 +35,6 @@ public class Config {
32
35
// The last resort host to try
33
36
public static final String DEFAULT_FALLBACK_HOST = "http://localhost:8080" ;
34
37
35
- private static final Logger log = Logger .getLogger (Config .class );
36
-
37
38
public static ApiClient fromCluster () throws IOException {
38
39
return ClientBuilder .cluster ().build ();
39
40
}
Original file line number Diff line number Diff line change 25
25
import java .util .HashMap ;
26
26
import java .util .Map ;
27
27
import org .apache .commons .codec .binary .Base64 ;
28
- import org .apache .log4j .Logger ;
28
+ import org .slf4j .Logger ;
29
+ import org .slf4j .LoggerFactory ;
29
30
import org .yaml .snakeyaml .Yaml ;
30
31
import org .yaml .snakeyaml .constructor .SafeConstructor ;
31
32
32
33
/** KubeConfig represents a kubernetes client configuration */
33
34
public class KubeConfig {
35
+ private static final Logger log = LoggerFactory .getLogger (KubeConfig .class );
36
+
34
37
// Defaults for where to find a kubeconfig file
35
38
public static final String ENV_HOME = "HOME" ;
36
39
public static final String KUBEDIR = ".kube" ;
@@ -49,8 +52,6 @@ public class KubeConfig {
49
52
Map <String , Object > currentUser ;
50
53
String currentNamespace ;
51
54
52
- private static final Logger log = Logger .getLogger (KubeConfig .class );
53
-
54
55
public static void registerAuthenticator (Authenticator auth ) {
55
56
synchronized (authenticators ) {
56
57
authenticators .put (auth .getName (), auth );
Original file line number Diff line number Diff line change 28
28
import java .util .HashMap ;
29
29
import java .util .Map ;
30
30
import okio .ByteString ;
31
- import org .apache .log4j .Logger ;
31
+ import org .slf4j .Logger ;
32
+ import org .slf4j .LoggerFactory ;
32
33
33
34
/**
34
35
* WebSocketStreamHandler understands the Kubernetes streaming protocol and separates a single
35
36
* WebSockets stream into a number of different streams using that protocol.
36
37
*/
37
38
public class WebSocketStreamHandler implements WebSockets .SocketListener , Closeable {
39
+ private static final Logger log = LoggerFactory .getLogger (WebSocketStreamHandler .class );
40
+
38
41
Map <Integer , PipedOutputStream > output ;
39
42
Map <Integer , PipedInputStream > input ;
40
43
WebSocket socket ;
41
44
String protocol ;
42
45
43
- private static final Logger log = Logger .getLogger (WebSockets .class );
44
-
45
46
public WebSocketStreamHandler () {
46
47
output = new HashMap <>();
47
48
input = new HashMap <>();
Original file line number Diff line number Diff line change 32
32
import java .util .HashMap ;
33
33
import java .util .List ;
34
34
import okio .Buffer ;
35
- import org .apache .log4j .Logger ;
35
+ import org .slf4j .Logger ;
36
+ import org .slf4j .LoggerFactory ;
36
37
37
38
public class WebSockets {
39
+ private static final Logger log = LoggerFactory .getLogger (WebSockets .class );
40
+
38
41
public static final String V4_STREAM_PROTOCOL = "v4.channel.k8s.io" ;
39
42
public static final String V3_STREAM_PROTOCOL = "v3.channel.k8s.io" ;
40
43
public static final String V2_STREAM_PROTOCOL = "v2.channel.k8s.io" ;
41
44
public static final String V1_STREAM_PROTOCOL = "channel.k8s.io" ;
42
45
public static final String STREAM_PROTOCOL_HEADER = "X-Stream-Protocol-Version" ;
43
46
public static final String SPDY_3_1 = "SPDY/3.1" ;
44
47
45
- private static final Logger log = Logger .getLogger (WebSockets .class );
46
-
47
48
/** A simple interface for a listener on a web socket */
48
49
public interface SocketListener {
49
50
/** Called when the socket is opened */
Original file line number Diff line number Diff line change 9
9
import java .security .cert .CertificateException ;
10
10
import java .security .spec .InvalidKeySpecException ;
11
11
import javax .net .ssl .KeyManager ;
12
- import org .apache .log4j .Logger ;
12
+ import org .slf4j .Logger ;
13
+ import org .slf4j .LoggerFactory ;
13
14
14
15
/** Uses Client Certificates to configure {@link ApiClient} authentication to the Kubernetes API. */
15
16
public class ClientCertificateAuthentication implements Authentication {
16
- private static final Logger log = Logger .getLogger (ClientCertificateAuthentication .class );
17
+ private static final Logger log = LoggerFactory .getLogger (ClientCertificateAuthentication .class );
17
18
private final byte [] certificate ;
18
19
private final byte [] key ;
19
20
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <configuration >
3
+ <appender name =" console" class =" ch.qos.logback.core.ConsoleAppender" >
4
+ <encoder >
5
+ <pattern >%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern >
6
+ </encoder >
7
+ </appender >
8
+
9
+ <root level =" info" >
10
+ <appender-ref ref =" console" />
11
+ </root >
12
+ </configuration >
You can’t perform that action at this time.
0 commit comments