diff --git a/apps/streaming/java/src/net/i2p/client/streaming/Packet.java b/apps/streaming/java/src/net/i2p/client/streaming/Packet.java
index e589b6273a06d8a7f5a85d9d0ff86f6307f23978..5a723b3d48a6841f590e825f9c99bbc330be82d5 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/Packet.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/Packet.java
@@ -449,7 +449,15 @@ class Packet {
             try {
                 System.arraycopy(_payload.getData(), _payload.getOffset(), buffer, cur, _payload.getValid());
             } catch (ArrayIndexOutOfBoundsException aioobe) {
-                System.err.println("payload.length: " + _payload.getValid() + " buffer.length: " + buffer.length + " cur: " + cur);
+                String error = "payload.length: " + _payload.getValid() + " buffer.length: " + buffer.length + " cur: " + cur;
+                I2PAppContext context = I2PAppContext.getCurrentContext();
+                if (context != null) {
+                    Log l = context.logManager().getLog(Packet.class);
+                    l.log(Log.ERROR,error,aioobe);
+                } else {
+                    System.err.println(error);
+                    aioobe.printStackTrace(System.out);
+                }
                 throw aioobe;
             }
             cur += _payload.getValid();