diff --git a/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java b/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java index a840394b63..82ee239579 100644 --- a/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java +++ b/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java @@ -77,19 +77,19 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator { PlatformDependent.maxDirectMemory() / defaultChunkSize / 2 / 3))); if (logger.isDebugEnabled()) { - logger.debug("io.netty.allocator.numHeapArenas: {}", DEFAULT_NUM_HEAP_ARENA); - logger.debug("io.netty.allocator.numDirectArenas: {}", DEFAULT_NUM_DIRECT_ARENA); + logger.debug("-Dio.netty.allocator.numHeapArenas: {}", DEFAULT_NUM_HEAP_ARENA); + logger.debug("-Dio.netty.allocator.numDirectArenas: {}", DEFAULT_NUM_DIRECT_ARENA); if (pageSizeFallbackCause == null) { - logger.debug("io.netty.allocator.pageSize: {}", DEFAULT_PAGE_SIZE); + logger.debug("-Dio.netty.allocator.pageSize: {}", DEFAULT_PAGE_SIZE); } else { - logger.debug("io.netty.allocator.pageSize: {}", DEFAULT_PAGE_SIZE, pageSizeFallbackCause); + logger.debug("-Dio.netty.allocator.pageSize: {}", DEFAULT_PAGE_SIZE, pageSizeFallbackCause); } if (maxOrderFallbackCause == null) { - logger.debug("io.netty.allocator.maxOrder: {}", DEFAULT_MAX_ORDER); + logger.debug("-Dio.netty.allocator.maxOrder: {}", DEFAULT_MAX_ORDER); } else { - logger.debug("io.netty.allocator.maxOrder: {}", DEFAULT_MAX_ORDER, maxOrderFallbackCause); + logger.debug("-Dio.netty.allocator.maxOrder: {}", DEFAULT_MAX_ORDER, maxOrderFallbackCause); } - logger.debug("io.netty.allocator.chunkSize: {}", DEFAULT_PAGE_SIZE << DEFAULT_MAX_ORDER); + logger.debug("-Dio.netty.allocator.chunkSize: {}", DEFAULT_PAGE_SIZE << DEFAULT_MAX_ORDER); } } diff --git a/common/src/main/java/io/netty/util/ResourceLeakDetector.java b/common/src/main/java/io/netty/util/ResourceLeakDetector.java index 6110b46715..be3111ccf6 100644 --- a/common/src/main/java/io/netty/util/ResourceLeakDetector.java +++ b/common/src/main/java/io/netty/util/ResourceLeakDetector.java @@ -35,7 +35,7 @@ public final class ResourceLeakDetector { private static final InternalLogger logger = InternalLoggerFactory.getInstance(ResourceLeakDetector.class); static { - logger.debug("io.netty.noResourceLeakDetection: {}", DISABLED); + logger.debug("-Dio.netty.noResourceLeakDetection: {}", DISABLED); } private static final int DEFAULT_SAMPLING_INTERVAL = 113; diff --git a/common/src/main/java/io/netty/util/internal/PlatformDependent.java b/common/src/main/java/io/netty/util/internal/PlatformDependent.java index 060f5d7bd3..df9b52d87c 100644 --- a/common/src/main/java/io/netty/util/internal/PlatformDependent.java +++ b/common/src/main/java/io/netty/util/internal/PlatformDependent.java @@ -73,7 +73,7 @@ public final class PlatformDependent { static { if (logger.isDebugEnabled()) { - logger.debug("io.netty.noPreferDirect: {}", !DIRECT_BUFFER_PREFERRED); + logger.debug("-Dio.netty.noPreferDirect: {}", !DIRECT_BUFFER_PREFERRED); } if (!hasUnsafe()) { @@ -446,12 +446,14 @@ public final class PlatformDependent { } private static boolean hasUnsafe0() { + boolean noUnsafe = SystemPropertyUtil.getBoolean("io.netty.noUnsafe", false); + logger.debug("-Dio.netty.noUnsafe: {}", noUnsafe); + if (isAndroid()) { logger.debug("sun.misc.Unsafe: unavailable (Android)"); return false; } - boolean noUnsafe = SystemPropertyUtil.getBoolean("io.netty.noUnsafe", false); if (noUnsafe) { logger.debug("sun.misc.Unsafe: unavailable (io.netty.noUnsafe)"); return false; @@ -550,6 +552,8 @@ public final class PlatformDependent { private static boolean hasJavassist0() { boolean noJavassist = SystemPropertyUtil.getBoolean("io.netty.noJavassist", false); + logger.debug("-Dio.netty.noJavassist: {}", noJavassist); + if (noJavassist) { logger.debug("Javassist: unavailable (io.netty.noJavassist)"); return false; diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java index 4b8c36fe94..461279c607 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java @@ -20,16 +20,14 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelOption; -import io.netty.testsuite.util.TestUtils; import io.netty.util.internal.SystemPropertyUtil; -import org.junit.Assert; +import io.netty.util.internal.logging.InternalLoggerFactory; import org.junit.Assume; import org.junit.Test; import java.io.IOException; import java.net.ConnectException; import java.net.InetSocketAddress; -import java.net.NoRouteToHostException; import java.net.Socket; import static org.hamcrest.CoreMatchers.*; @@ -39,6 +37,11 @@ public class SocketConnectionAttemptTest extends AbstractClientSocketTest { private static final String BAD_HOST = SystemPropertyUtil.get("io.netty.testsuite.badHost", "255.255.255.0"); + static { + InternalLoggerFactory.getInstance(SocketConnectionAttemptTest.class).debug( + "-Dio.netty.testsuite.badHost: {}", BAD_HOST); + } + @Test(timeout = 30000) public void testConnectTimeout() throws Throwable { run(); diff --git a/transport/src/main/java/io/netty/channel/MultithreadEventLoopGroup.java b/transport/src/main/java/io/netty/channel/MultithreadEventLoopGroup.java index ab27b219b3..1faa53b5c7 100644 --- a/transport/src/main/java/io/netty/channel/MultithreadEventLoopGroup.java +++ b/transport/src/main/java/io/netty/channel/MultithreadEventLoopGroup.java @@ -38,7 +38,7 @@ public abstract class MultithreadEventLoopGroup extends MultithreadEventExecutor "io.netty.eventLoopThreads", Runtime.getRuntime().availableProcessors() * 2)); if (logger.isDebugEnabled()) { - logger.debug("io.netty.eventLoopThreads: {}", DEFAULT_EVENT_LOOP_THREADS); + logger.debug("-Dio.netty.eventLoopThreads: {}", DEFAULT_EVENT_LOOP_THREADS); } } diff --git a/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java b/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java index dfd6efd801..6f21dc9b35 100644 --- a/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java +++ b/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java @@ -84,8 +84,8 @@ public final class NioEventLoop extends SingleThreadEventLoop { SELECTOR_AUTO_REBUILD_THRESHOLD = selectorAutoRebuildThreshold; if (logger.isDebugEnabled()) { - logger.debug("io.netty.noKeySetOptimization: {}", DISABLE_KEYSET_OPTIMIZATION); - logger.debug("io.netty.selectorAutoRebuildThreshold: {}", SELECTOR_AUTO_REBUILD_THRESHOLD); + logger.debug("-Dio.netty.noKeySetOptimization: {}", DISABLE_KEYSET_OPTIMIZATION); + logger.debug("-Dio.netty.selectorAutoRebuildThreshold: {}", SELECTOR_AUTO_REBUILD_THRESHOLD); } }