summaryrefslogtreecommitdiffstats
path: root/external/java_websocket/patches/no-slf4j.patch
blob: 27296071eff73954cc3e6b2c3b2d0a3bbc2dbf8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
diff -ru a/src/main/java/org/java_websocket/AbstractWebSocket.java b/src/main/java/org/java_websocket/AbstractWebSocket.java
--- a/src/main/java/org/java_websocket/AbstractWebSocket.java	2023-07-20 21:24:05.000000000 +0100
+++ b/src/main/java/org/java_websocket/AbstractWebSocket.java	2023-08-30 12:06:11.004719499 +0100
@@ -33,9 +33,7 @@
 import java.util.concurrent.TimeUnit;
 import org.java_websocket.framing.CloseFrame;
 import org.java_websocket.util.NamedThreadFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import java.util.logging.Logger;
 
 /**
  * Base class for additional implementations for the server as well as the client
@@ -47,7 +45,7 @@
    *
    * @since 1.4.0
    */
-  private final Logger log = LoggerFactory.getLogger(AbstractWebSocket.class);
+  private final Logger log = Logger.getLogger(AbstractWebSocket.class.getName());
 
   /**
    * Attribute which allows you to deactivate the Nagle's algorithm
@@ -118,12 +116,12 @@
     synchronized (syncConnectionLost) {
       this.connectionLostTimeout = TimeUnit.SECONDS.toNanos(connectionLostTimeout);
       if (this.connectionLostTimeout <= 0) {
-        log.trace("Connection lost timer stopped");
+        log.fine("Connection lost timer stopped");
         cancelConnectionLostTimer();
         return;
       }
       if (this.websocketRunning) {
-        log.trace("Connection lost timer restarted");
+        log.fine("Connection lost timer restarted");
         //Reset all the pings
         try {
           ArrayList<WebSocket> connections = new ArrayList<>(getConnections());
@@ -135,7 +133,7 @@
             }
           }
         } catch (Exception e) {
-          log.error("Exception during connection lost restart", e);
+          log.severe("Exception during connection lost restart" + " : " + e);
         }
         restartConnectionLostTimer();
       }
@@ -151,7 +149,7 @@
     synchronized (syncConnectionLost) {
       if (connectionLostCheckerService != null || connectionLostCheckerFuture != null) {
         this.websocketRunning = false;
-        log.trace("Connection lost timer stopped");
+        log.fine("Connection lost timer stopped");
         cancelConnectionLostTimer();
       }
     }
@@ -165,10 +163,10 @@
   protected void startConnectionLostTimer() {
     synchronized (syncConnectionLost) {
       if (this.connectionLostTimeout <= 0) {
-        log.trace("Connection lost timer deactivated");
+        log.fine("Connection lost timer deactivated");
         return;
       }
-      log.trace("Connection lost timer started");
+      log.fine("Connection lost timer started");
       this.websocketRunning = true;
       restartConnectionLostTimer();
     }
@@ -228,14 +226,14 @@
     }
     WebSocketImpl webSocketImpl = (WebSocketImpl) webSocket;
     if (webSocketImpl.getLastPong() < minimumPongTime) {
-      log.trace("Closing connection due to no pong received: {}", webSocketImpl);
+      log.fine("Closing connection due to no pong received: {}" + " : " + webSocketImpl);
       webSocketImpl.closeConnection(CloseFrame.ABNORMAL_CLOSE,
           "The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection");
     } else {
       if (webSocketImpl.isOpen()) {
         webSocketImpl.sendPing();
       } else {
-        log.trace("Trying to ping a non open connection: {}", webSocketImpl);
+        log.fine("Trying to ping a non open connection: {}" + " : " + webSocketImpl);
       }
     }
   }
diff -ru a/src/main/java/org/java_websocket/drafts/Draft_6455.java b/src/main/java/org/java_websocket/drafts/Draft_6455.java
--- a/src/main/java/org/java_websocket/drafts/Draft_6455.java	2023-07-20 21:24:05.000000000 +0100
+++ b/src/main/java/org/java_websocket/drafts/Draft_6455.java	2023-08-30 12:16:03.534083539 +0100
@@ -66,8 +66,8 @@
 import org.java_websocket.protocols.Protocol;
 import org.java_websocket.util.Base64;
 import org.java_websocket.util.Charsetfunctions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Implementation for the RFC 6455 websocket protocol This is the recommended class for your
@@ -110,7 +110,7 @@
    *
    * @since 1.4.0
    */
-  private final Logger log = LoggerFactory.getLogger(Draft_6455.class);
+  private final Logger log = Logger.getLogger(Draft_6455.class.getName());
 
   /**
    * Attribute for the used extension in this draft
@@ -263,7 +263,7 @@
       throws InvalidHandshakeException {
     int v = readVersion(handshakedata);
     if (v != 13) {
-      log.trace("acceptHandshakeAsServer - Wrong websocket version.");
+      log.fine("acceptHandshakeAsServer - Wrong websocket version.");
       return HandshakeState.NOT_MATCHED;
     }
     HandshakeState extensionState = HandshakeState.NOT_MATCHED;
@@ -272,7 +272,7 @@
       if (knownExtension.acceptProvidedExtensionAsServer(requestedExtension)) {
         negotiatedExtension = knownExtension;
         extensionState = HandshakeState.MATCHED;
-        log.trace("acceptHandshakeAsServer - Matching extension found: {}", negotiatedExtension);
+        log.fine("acceptHandshakeAsServer - Matching extension found: {}" + " : " + negotiatedExtension);
         break;
       }
     }
@@ -281,7 +281,7 @@
     if (protocolState == HandshakeState.MATCHED && extensionState == HandshakeState.MATCHED) {
       return HandshakeState.MATCHED;
     }
-    log.trace("acceptHandshakeAsServer - No matching extension or protocol found.");
+    log.fine("acceptHandshakeAsServer - No matching extension or protocol found.");
     return HandshakeState.NOT_MATCHED;
   }
 
@@ -295,7 +295,7 @@
     for (IProtocol knownProtocol : knownProtocols) {
       if (knownProtocol.acceptProvidedProtocol(requestedProtocol)) {
         protocol = knownProtocol;
-        log.trace("acceptHandshake - Matching protocol found: {}", protocol);
+        log.fine("acceptHandshake - Matching protocol found: {}" + " : " + protocol);
         return HandshakeState.MATCHED;
       }
     }
@@ -306,12 +306,12 @@
   public HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response)
       throws InvalidHandshakeException {
     if (!basicAccept(response)) {
-      log.trace("acceptHandshakeAsClient - Missing/wrong upgrade or connection in handshake.");
+      log.fine("acceptHandshakeAsClient - Missing/wrong upgrade or connection in handshake.");
       return HandshakeState.NOT_MATCHED;
     }
     if (!request.hasFieldValue(SEC_WEB_SOCKET_KEY) || !response
         .hasFieldValue(SEC_WEB_SOCKET_ACCEPT)) {
-      log.trace("acceptHandshakeAsClient - Missing Sec-WebSocket-Key or Sec-WebSocket-Accept");
+      log.fine("acceptHandshakeAsClient - Missing Sec-WebSocket-Key or Sec-WebSocket-Accept");
       return HandshakeState.NOT_MATCHED;
     }
 
@@ -320,7 +320,7 @@
     seckeyChallenge = generateFinalKey(seckeyChallenge);
 
     if (!seckeyChallenge.equals(seckeyAnswer)) {
-      log.trace("acceptHandshakeAsClient - Wrong key for Sec-WebSocket-Key.");
+      log.fine("acceptHandshakeAsClient - Wrong key for Sec-WebSocket-Key.");
       return HandshakeState.NOT_MATCHED;
     }
     HandshakeState extensionState = HandshakeState.NOT_MATCHED;
@@ -329,7 +329,7 @@
       if (knownExtension.acceptProvidedExtensionAsClient(requestedExtension)) {
         negotiatedExtension = knownExtension;
         extensionState = HandshakeState.MATCHED;
-        log.trace("acceptHandshakeAsClient - Matching extension found: {}", negotiatedExtension);
+        log.fine("acceptHandshakeAsClient - Matching extension found: {}" + " : " + negotiatedExtension);
         break;
       }
     }
@@ -338,7 +338,7 @@
     if (protocolState == HandshakeState.MATCHED && extensionState == HandshakeState.MATCHED) {
       return HandshakeState.MATCHED;
     }
-    log.trace("acceptHandshakeAsClient - No matching extension or protocol found.");
+    log.fine("acceptHandshakeAsClient - No matching extension or protocol found.");
     return HandshakeState.NOT_MATCHED;
   }
 
@@ -467,8 +467,8 @@
   @Override
   public ByteBuffer createBinaryFrame(Framedata framedata) {
     getExtension().encodeFrame(framedata);
-    if (log.isTraceEnabled()) {
-      log.trace("afterEnconding({}): {}", framedata.getPayloadData().remaining(),
+    if (log.isLoggable(Level.FINE)) {
+      log.fine("afterEnconding({}): {}" + " : " + framedata.getPayloadData().remaining() + " : " +
           (framedata.getPayloadData().remaining() > 1000 ? "too big to display"
               : new String(framedata.getPayloadData().array())));
     }
@@ -587,8 +587,8 @@
     }
     currentDecodingExtension.isFrameValid(frame);
     currentDecodingExtension.decodeFrame(frame);
-    if (log.isTraceEnabled()) {
-      log.trace("afterDecoding({}): {}", frame.getPayloadData().remaining(),
+    if (log.isLoggable(Level.FINE)) {
+      log.fine("afterDecoding({}): {}" + " : " + frame.getPayloadData().remaining() + " : " +
           (frame.getPayloadData().remaining() > 1000 ? "too big to display"
               : new String(frame.getPayloadData().array())));
     }
@@ -615,7 +615,7 @@
     int payloadlength = oldPayloadlength;
     int realpacketsize = oldRealpacketsize;
     if (optcode == Opcode.PING || optcode == Opcode.PONG || optcode == Opcode.CLOSING) {
-      log.trace("Invalid frame: more than 125 octets");
+      log.fine("Invalid frame: more than 125 octets");
       throw new InvalidFrameException("more than 125 octets");
     }
     if (payloadlength == 126) {
@@ -647,15 +647,15 @@
    */
   private void translateSingleFrameCheckLengthLimit(long length) throws LimitExceededException {
     if (length > Integer.MAX_VALUE) {
-      log.trace("Limit exedeed: Payloadsize is to big...");
+      log.fine("Limit exedeed: Payloadsize is to big...");
       throw new LimitExceededException("Payloadsize is to big...");
     }
     if (length > maxFrameSize) {
-      log.trace("Payload limit reached. Allowed: {} Current: {}", maxFrameSize, length);
+      log.fine("Payload limit reached. Allowed: {} Current: {}" + " : " + maxFrameSize + " : " + length);
       throw new LimitExceededException("Payload limit reached.", maxFrameSize);
     }
     if (length < 0) {
-      log.trace("Limit underflow: Payloadsize is to little...");
+      log.fine("Limit underflow: Payloadsize is to little...");
       throw new LimitExceededException("Payloadsize is to little...");
     }
   }
@@ -670,7 +670,7 @@
   private void translateSingleFrameCheckPacketSize(int maxpacketsize, int realpacketsize)
       throws IncompleteException {
     if (maxpacketsize < realpacketsize) {
-      log.trace("Incomplete frame: maxpacketsize < realpacketsize");
+      log.fine("Incomplete frame: maxpacketsize < realpacketsize");
       throw new IncompleteException(realpacketsize);
     }
   }
@@ -903,7 +903,7 @@
     } else if (!frame.isFin() || curop == Opcode.CONTINUOUS) {
       processFrameContinuousAndNonFin(webSocketImpl, frame, curop);
     } else if (currentContinuousFrame != null) {
-      log.error("Protocol error: Continuous frame sequence not completed.");
+      log.severe("Protocol error: Continuous frame sequence not completed.");
       throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR,
           "Continuous frame sequence not completed.");
     } else if (curop == Opcode.TEXT) {
@@ -911,7 +911,7 @@
     } else if (curop == Opcode.BINARY) {
       processFrameBinary(webSocketImpl, frame);
     } else {
-      log.error("non control or continious frame expected");
+      log.severe("non control or continious frame expected");
       throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR,
           "non control or continious frame expected");
     }
@@ -932,13 +932,13 @@
     } else if (frame.isFin()) {
       processFrameIsFin(webSocketImpl, frame);
     } else if (currentContinuousFrame == null) {
-      log.error("Protocol error: Continuous frame sequence was not started.");
+      log.severe("Protocol error: Continuous frame sequence was not started.");
       throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR,
           "Continuous frame sequence was not started.");
     }
     //Check if the whole payload is valid utf8, when the opcode indicates a text
     if (curop == Opcode.TEXT && !Charsetfunctions.isValidUTF8(frame.getPayloadData())) {
-      log.error("Protocol error: Payload is not UTF8");
+      log.severe("Protocol error: Payload is not UTF8");
       throw new InvalidDataException(CloseFrame.NO_UTF8);
     }
     //Checking if the current continuous frame contains a correct payload with the other frames combined
@@ -969,7 +969,7 @@
    * @param e             the runtime exception
    */
   private void logRuntimeException(WebSocketImpl webSocketImpl, RuntimeException e) {
-    log.error("Runtime exception during onWebsocketMessage", e);
+    log.severe("Runtime exception during onWebsocketMessage" + " : " + e);
     webSocketImpl.getWebSocketListener().onWebsocketError(webSocketImpl, e);
   }
 
@@ -999,7 +999,7 @@
   private void processFrameIsFin(WebSocketImpl webSocketImpl, Framedata frame)
       throws InvalidDataException {
     if (currentContinuousFrame == null) {
-      log.trace("Protocol error: Previous continuous frame sequence not completed.");
+      log.fine("Protocol error: Previous continuous frame sequence not completed.");
       throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR,
           "Continuous frame sequence was not started.");
     }
@@ -1036,7 +1036,7 @@
    */
   private void processFrameIsNotFin(Framedata frame) throws InvalidDataException {
     if (currentContinuousFrame != null) {
-      log.trace("Protocol error: Previous continuous frame sequence not completed.");
+      log.fine("Protocol error: Previous continuous frame sequence not completed.");
       throw new InvalidDataException(CloseFrame.PROTOCOL_ERROR,
           "Previous continuous frame sequence not completed.");
     }
@@ -1102,7 +1102,7 @@
     long totalSize = getByteBufferListSize();
     if (totalSize > maxFrameSize) {
       clearBufferList();
-      log.trace("Payload limit reached. Allowed: {} Current: {}", maxFrameSize, totalSize);
+      log.fine("Payload limit reached. Allowed: {} Current: {}" + " : " + maxFrameSize + " : " + totalSize);
       throw new LimitExceededException(maxFrameSize);
     }
   }
diff -ru a/src/main/java/org/java_websocket/server/WebSocketServer.java b/src/main/java/org/java_websocket/server/WebSocketServer.java
--- a/src/main/java/org/java_websocket/server/WebSocketServer.java	2023-07-20 21:24:05.000000000 +0100
+++ b/src/main/java/org/java_websocket/server/WebSocketServer.java	2023-08-30 12:06:46.372798355 +0100
@@ -67,8 +67,7 @@
 import org.java_websocket.framing.Framedata;
 import org.java_websocket.handshake.ClientHandshake;
 import org.java_websocket.handshake.Handshakedata;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.logging.Logger;
 
 /**
  * <tt>WebSocketServer</tt> is an abstract class that only takes care of the
@@ -84,7 +83,7 @@
    *
    * @since 1.4.0
    */
-  private final Logger log = LoggerFactory.getLogger(WebSocketServer.class);
+  private final Logger log = Logger.getLogger(WebSocketServer.class.getName());
 
   /**
    * Holds the list of active WebSocket connections. "Active" means WebSocket handshake is complete
@@ -611,7 +610,7 @@
       try {
         selector.close();
       } catch (IOException e) {
-        log.error("IOException during selector.close", e);
+        log.severe("IOException during selector.close" + " : " + e);
         onError(null, e);
       }
     }
@@ -619,7 +618,7 @@
       try {
         server.close();
       } catch (IOException e) {
-        log.error("IOException during server.close", e);
+        log.severe("IOException during server.close" + " : " + e);
         onError(null, e);
       }
     }
@@ -677,13 +676,13 @@
         } catch (IOException e) {
           // there is nothing that must be done here
         }
-        log.trace("Connection closed because of exception", ex);
+        log.fine("Connection closed because of exception" + " : " + ex);
       }
     }
   }
 
   private void handleFatal(WebSocket conn, Exception e) {
-    log.error("Shutdown due to fatal error", e);
+    log.severe("Shutdown due to fatal error" + " : " + e);
     onError(conn, e);
 
     String causeMessage = e.getCause() != null ? " caused by " + e.getCause().getClass().getName() : "";
@@ -692,7 +691,7 @@
       stop(0, errorMessage);
     } catch (InterruptedException e1) {
       Thread.currentThread().interrupt();
-      log.error("Interrupt during stop", e);
+      log.severe("Interrupt during stop" + " : " + e);
       onError(null, e1);
     }
 
@@ -760,8 +759,8 @@
         removed = this.connections.remove(ws);
       } else {
         //Don't throw an assert error if the ws is not in the list. e.g. when the other endpoint did not send any handshake. see #512
-        log.trace(
-            "Removing connection which is not in the connections collection! Possible no handshake received! {}",
+        log.fine(
+            "Removing connection which is not in the connections collection! Possible no handshake received! {}" + " : " +
             ws);
       }
     }
@@ -1065,7 +1064,7 @@
       setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
         @Override
         public void uncaughtException(Thread t, Throwable e) {
-          log.error("Uncaught exception in thread {}: {}", t.getName(), e);
+          log.severe("Uncaught exception in thread {}: {}" + " : " + t.getName() + " : " + e);
         }
       });
     }
@@ -1089,11 +1088,11 @@
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
       } catch (VirtualMachineError | ThreadDeath | LinkageError e) {
-        log.error("Got fatal error in worker thread {}", getName());
+        log.severe("Got fatal error in worker thread {}" + " : " + getName());
         Exception exception = new Exception(e);
         handleFatal(ws, exception);
       } catch (Throwable e) {
-        log.error("Uncaught exception in thread {}: {}", getName(), e);
+        log.severe("Uncaught exception in thread {}: {}" + " : " + getName() + " : " + e);
         if (ws != null) {
           Exception exception = new Exception(e);
           onWebsocketError(ws, exception);
@@ -1113,7 +1112,7 @@
       try {
         ws.decode(buf);
       } catch (Exception e) {
-        log.error("Error while reading from remote connection", e);
+        log.severe("Error while reading from remote connection" + " : " + e);
       } finally {
         pushBuffer(buf);
       }
diff -ru a/src/main/java/org/java_websocket/SSLSocketChannel2.java b/src/main/java/org/java_websocket/SSLSocketChannel2.java
--- a/src/main/java/org/java_websocket/SSLSocketChannel2.java	2023-07-20 21:24:05.000000000 +0100
+++ b/src/main/java/org/java_websocket/SSLSocketChannel2.java	2023-08-30 12:05:33.937636854 +0100
@@ -47,8 +47,8 @@
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSession;
 import org.java_websocket.interfaces.ISSLChannel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Implements the relevant portions of the SocketChannel interface with the SSLEngine wrapper.
@@ -66,7 +66,7 @@
    *
    * @since 1.4.0
    */
-  private final Logger log = LoggerFactory.getLogger(SSLSocketChannel2.class);
+  private final Logger log = Logger.getLogger(SSLSocketChannel2.class.getName());
 
   protected ExecutorService exec;
 
@@ -256,13 +256,13 @@
         inCrypt = ByteBuffer.allocate(netBufferMax);
       }
     }
-    if (inData.remaining() != 0 && log.isTraceEnabled()) {
-      log.trace(new String(inData.array(), inData.position(), inData.remaining()));
+    if (inData.remaining() != 0 && log.isLoggable(Level.FINE)) {
+      log.fine(new String(inData.array(), inData.position(), inData.remaining()));
     }
     inData.rewind();
     inData.flip();
-    if (inCrypt.remaining() != 0 && log.isTraceEnabled()) {
-      log.trace(new String(inCrypt.array(), inCrypt.position(), inCrypt.remaining()));
+    if (inCrypt.remaining() != 0 && log.isLoggable(Level.FINE)) {
+      log.fine(new String(inCrypt.array(), inCrypt.position(), inCrypt.remaining()));
     }
     inCrypt.rewind();
     inCrypt.flip();
@@ -498,4 +498,4 @@
       saveCryptData = null;
     }
   }
-}
\ No newline at end of file
+}
diff -ru a/src/main/java/org/java_websocket/SSLSocketChannel.java b/src/main/java/org/java_websocket/SSLSocketChannel.java
--- a/src/main/java/org/java_websocket/SSLSocketChannel.java	2023-07-20 21:24:05.000000000 +0100
+++ b/src/main/java/org/java_websocket/SSLSocketChannel.java	2023-08-30 11:55:09.427244528 +0100
@@ -39,8 +39,7 @@
 import javax.net.ssl.SSLSession;
 import org.java_websocket.interfaces.ISSLChannel;
 import org.java_websocket.util.ByteBufferUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.logging.Logger;
 
 
 /**
@@ -70,7 +69,7 @@
    *
    * @since 1.4.0
    */
-  private final Logger log = LoggerFactory.getLogger(SSLSocketChannel.class);
+  private final Logger log = Logger.getLogger(SSLSocketChannel.class.getName());
 
   /**
    * The underlying socket channel
@@ -148,7 +147,7 @@
       try {
         socketChannel.close();
       } catch (IOException e) {
-        log.error("Exception during the closing of the channel", e);
+        log.severe("Exception during the closing of the channel" + " : " + e);
       }
     }
   }
@@ -176,7 +175,7 @@
         try {
           result = engine.unwrap(peerNetData, peerAppData);
         } catch (SSLException e) {
-          log.error("SSLException during unwrap", e);
+          log.severe("SSLException during unwrap" + " : " + e);
           throw e;
         }
         switch (result.getStatus()) {
@@ -490,7 +489,7 @@
     try {
       engine.closeInbound();
     } catch (Exception e) {
-      log.error(
+      log.severe(
           "This engine was forced to close inbound, without having received the proper SSL/TLS close notification message from the peer, due to end of stream.");
     }
     closeConnection();
@@ -536,4 +535,4 @@
   public SSLEngine getSSLEngine() {
     return engine;
   }
-}
\ No newline at end of file
+}
diff -ru a/src/main/java/org/java_websocket/WebSocketImpl.java b/src/main/java/org/java_websocket/WebSocketImpl.java
--- a/src/main/java/org/java_websocket/WebSocketImpl.java	2023-07-20 21:24:05.000000000 +0100
+++ b/src/main/java/org/java_websocket/WebSocketImpl.java	2023-08-30 12:12:26.045577651 +0100
@@ -61,8 +61,8 @@
 import org.java_websocket.protocols.IProtocol;
 import org.java_websocket.server.WebSocketServer.WebSocketWorker;
 import org.java_websocket.util.Charsetfunctions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Represents one end (client or server) of a single WebSocketImpl connection. Takes care of the
@@ -95,7 +95,7 @@
    *
    * @since 1.4.0
    */
-  private final Logger log = LoggerFactory.getLogger(WebSocketImpl.class);
+  private final Logger log = Logger.getLogger(WebSocketImpl.class.getName());
 
   /**
    * Queue of buffers that need to be sent to the client.
@@ -224,8 +224,8 @@
    */
   public void decode(ByteBuffer socketBuffer) {
     assert (socketBuffer.hasRemaining());
-    if (log.isTraceEnabled()) {
-      log.trace("process({}): ({})", socketBuffer.remaining(),
+    if (log.isLoggable(Level.FINE)) {
+      log.fine("process({}): ({})" + " : " + socketBuffer.remaining() + " : " +
               (socketBuffer.remaining() > 1000 ? "too big to display"
                       : new String(socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining())));
     }
@@ -280,7 +280,7 @@
                 socketBuffer.reset();
                 Handshakedata tmphandshake = d.translateHandshake(socketBuffer);
                 if (!(tmphandshake instanceof ClientHandshake)) {
-                  log.trace("Closing due to wrong handshake");
+                  log.fine("Closing due to wrong handshake");
                   closeConnectionDueToWrongHandshake(
                       new InvalidDataException(CloseFrame.PROTOCOL_ERROR, "wrong http function"));
                   return false;
@@ -293,11 +293,11 @@
                   try {
                     response = wsl.onWebsocketHandshakeReceivedAsServer(this, d, handshake);
                   } catch (InvalidDataException e) {
-                    log.trace("Closing due to wrong handshake. Possible handshake rejection", e);
+                    log.fine("Closing due to wrong handshake. Possible handshake rejection" + " : " + e);
                     closeConnectionDueToWrongHandshake(e);
                     return false;
                   } catch (RuntimeException e) {
-                    log.error("Closing due to internal server error", e);
+                    log.severe("Closing due to internal server error" + " : " + e);
                     wsl.onWebsocketError(this, e);
                     closeConnectionDueToInternalServerError(e);
                     return false;
@@ -313,7 +313,7 @@
               }
             }
             if (draft == null) {
-              log.trace("Closing due to protocol error: no draft matches");
+              log.fine("Closing due to protocol error: no draft matches");
               closeConnectionDueToWrongHandshake(
                   new InvalidDataException(CloseFrame.PROTOCOL_ERROR, "no draft matches"));
             }
@@ -322,7 +322,7 @@
             // special case for multiple step handshakes
             Handshakedata tmphandshake = draft.translateHandshake(socketBuffer);
             if (!(tmphandshake instanceof ClientHandshake)) {
-              log.trace("Closing due to protocol error: wrong http function");
+              log.fine("Closing due to protocol error: wrong http function");
               flushAndClose(CloseFrame.PROTOCOL_ERROR, "wrong http function", false);
               return false;
             }
@@ -333,7 +333,7 @@
               open(handshake);
               return true;
             } else {
-              log.trace("Closing due to protocol error: the handshake did finally not match");
+              log.fine("Closing due to protocol error: the handshake did finally not match");
               close(CloseFrame.PROTOCOL_ERROR, "the handshake did finally not match");
             }
             return false;
@@ -342,7 +342,7 @@
           draft.setParseMode(role);
           Handshakedata tmphandshake = draft.translateHandshake(socketBuffer);
           if (!(tmphandshake instanceof ServerHandshake)) {
-            log.trace("Closing due to protocol error: wrong http function");
+            log.fine("Closing due to protocol error: wrong http function");
             flushAndClose(CloseFrame.PROTOCOL_ERROR, "wrong http function", false);
             return false;
           }
@@ -352,11 +352,11 @@
             try {
               wsl.onWebsocketHandshakeReceivedAsClient(this, handshakerequest, handshake);
             } catch (InvalidDataException e) {
-              log.trace("Closing due to invalid data exception. Possible handshake rejection", e);
+              log.fine("Closing due to invalid data exception. Possible handshake rejection" + " : " + e);
               flushAndClose(e.getCloseCode(), e.getMessage(), false);
               return false;
             } catch (RuntimeException e) {
-              log.error("Closing since client was never connected", e);
+              log.severe("Closing since client was never connected" + " : " + e);
               wsl.onWebsocketError(this, e);
               flushAndClose(CloseFrame.NEVER_CONNECTED, e.getMessage(), false);
               return false;
@@ -364,12 +364,12 @@
             open(handshake);
             return true;
           } else {
-            log.trace("Closing due to protocol error: draft {} refuses handshake", draft);
+            log.fine("Closing due to protocol error: draft {} refuses handshake" + " : " + draft);
             close(CloseFrame.PROTOCOL_ERROR, "draft " + draft + " refuses handshake");
           }
         }
       } catch (InvalidHandshakeException e) {
-        log.trace("Closing due to invalid handshake", e);
+        log.fine("Closing due to invalid handshake" + " : " + e);
         close(e);
       }
     } catch (IncompleteHandshakeException e) {
@@ -398,24 +398,24 @@
     try {
       frames = draft.translateFrame(socketBuffer);
       for (Framedata f : frames) {
-        log.trace("matched frame: {}", f);
+        log.fine("matched frame: {}" + " : " + f);
         draft.processFrame(this, f);
       }
     } catch (LimitExceededException e) {
       if (e.getLimit() == Integer.MAX_VALUE) {
-        log.error("Closing due to invalid size of frame", e);
+        log.severe("Closing due to invalid size of frame" + " : " + e);
         wsl.onWebsocketError(this, e);
       }
       close(e);
     } catch (InvalidDataException e) {
-      log.error("Closing due to invalid data in frame", e);
+      log.severe("Closing due to invalid data in frame" + " : " + e);
       wsl.onWebsocketError(this, e);
       close(e);
     } catch (VirtualMachineError | ThreadDeath | LinkageError e) {
-      log.error("Got fatal error during frame processing");
+      log.severe("Got fatal error during frame processing");
       throw e;
     } catch (Error e) {
-      log.error("Closing web socket due to an error during frame processing");
+      log.severe("Closing web socket due to an error during frame processing");
       Exception exception = new Exception(e);
       wsl.onWebsocketError(this, exception);
       String errorMessage = "Got error " + e.getClass().getName();
@@ -491,7 +491,7 @@
               sendFrame(closeFrame);
             }
           } catch (InvalidDataException e) {
-            log.error("generated frame is invalid", e);
+            log.severe("generated frame is invalid" + " : " + e);
             wsl.onWebsocketError(this, e);
             flushAndClose(CloseFrame.ABNORMAL_CLOSE, "generated frame is invalid", false);
           }
@@ -551,9 +551,9 @@
         channel.close();
       } catch (IOException e) {
         if (e.getMessage() != null && e.getMessage().equals("Broken pipe")) {
-          log.trace("Caught IOException: Broken pipe during closeConnection()", e);
+          log.fine("Caught IOException: Broken pipe during closeConnection()" + " : " + e);
         } else {
-          log.error("Exception during channel.close()", e);
+          log.severe("Exception during channel.close()" + " : " + e);
           wsl.onWebsocketError(this, e);
         }
       }
@@ -601,7 +601,7 @@
     try {
       wsl.onWebsocketClosing(this, code, message, remote);
     } catch (RuntimeException e) {
-      log.error("Exception in onWebsocketClosing", e);
+      log.severe("Exception in onWebsocketClosing" + " : " + e);
       wsl.onWebsocketError(this, e);
     }
     if (draft != null) {
@@ -678,7 +678,7 @@
     }
     ArrayList<ByteBuffer> outgoingFrames = new ArrayList<>();
     for (Framedata f : frames) {
-      log.trace("send frame: {}", f);
+      log.fine("send frame: {}" + " : " + f);
       outgoingFrames.add(draft.createBinaryFrame(f));
     }
     write(outgoingFrames);
@@ -729,7 +729,7 @@
       // Stop if the client code throws an exception
       throw new InvalidHandshakeException("Handshake data rejected by client.");
     } catch (RuntimeException e) {
-      log.error("Exception in startHandshake", e);
+      log.severe("Exception in startHandshake" + " : " + e);
       wsl.onWebsocketError(this, e);
       throw new InvalidHandshakeException("rejected because of " + e);
     }
@@ -739,8 +739,8 @@
   }
 
   private void write(ByteBuffer buf) {
-    log.trace("write({}): {}", buf.remaining(),
-        buf.remaining() > 1000 ? "too big to display" : new String(buf.array()));
+    log.fine("write({}): {}" + " : " + buf.remaining() + " : " +
+        (buf.remaining() > 1000 ? "too big to display" : new String(buf.array())));
 
     outQueue.add(buf);
     wsl.onWriteDemand(this);
@@ -760,7 +760,7 @@
   }
 
   private void open(Handshakedata d) {
-    log.trace("open using draft: {}", draft);
+    log.fine("open using draft: {}" + " : " + draft);
     readyState = ReadyState.OPEN;
     updateLastPong();
     try {