Refine search
public static void initNettyLogger() { if (!nettyLoggerSeted.get()) { try { io.netty.util.internal.logging.InternalLoggerFactory.setDefaultFactory(new NettyBridgeLoggerFactory()); } catch (Throwable e) { //ignore } nettyLoggerSeted.set(true); } }
private static final InternalLogger logger = InternalLoggerFactory.getInstance(MultithreadEventLoopGroup.class); "io.netty.eventLoopThreads", NettyRuntime.availableProcessors() * 2)); if (logger.isDebugEnabled()) { logger.debug("-Dio.netty.eventLoopThreads: {}", DEFAULT_EVENT_LOOP_THREADS);
public static void setNettyLoggerFactory() { InternalLoggerFactory factory = InternalLoggerFactory.getDefaultFactory(); if (factory == null || !(factory instanceof LtsLoggerFactory)) { InternalLoggerFactory.setDefaultFactory(new LtsLoggerFactory()); } }
/** * Creates a new logger instance with the specified name. */ public static InternalLogger getInstance(String name) { return getDefaultFactory().newInstance(name); }
/** * Creates a new instance whose logger name is the fully qualified class * name of the instance. * * @param level the log level */ public LoggingHandler(LogLevel level) { if (level == null) { throw new NullPointerException("level"); } logger = InternalLoggerFactory.getInstance(getClass()); this.level = level; internalLevel = level.toInternalLevel(); }
InternalLoggerFactory.getInstance(ReferenceCountedOpenSslContext.class); dhLen = Integer.valueOf(dhKeySize); } catch (NumberFormatException e) { logger.debug("ReferenceCountedOpenSslContext supports -Djdk.tls.ephemeralDHKeySize={int}, but got: " + dhKeySize);
public void start() { Configuration config = Configuration.INSTANCE; InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.INSTANCE); bossGroup = new NioEventLoopGroup(1); workerGroup = new NioEventLoopGroup(); log.info("\tStartup {}-{}-client [{}{}]", Constants.APP_NAME, Constants.APP_VERSION, config.getMode(), config.getMode().equals("socks5") ? "" : ":" + config.getProtocol()); new Thread(() -> new UdpServer().start()).start(); ChannelFuture future = bootstrap.bind(config.getLocalHost(), config.getLocalPort()).sync(); future.addListener(future1 -> log.info("\tTCP listening at {}:{}...", config.getLocalHost(), config.getLocalPort())); future.channel().closeFuture().sync(); } catch (Exception e) { log.error("\tSocket bind failure ({})", e.getMessage()); } finally { log.info("\tShutting down");
@SuppressWarnings("UnusedCatchParameter") private static InternalLoggerFactory newDefaultFactory(String name) { InternalLoggerFactory f; try { f = new Slf4JLoggerFactory(true); f.newInstance(name).debug("Using SLF4J as the default logging framework"); } catch (Throwable ignore1) { try { f = Log4JLoggerFactory.INSTANCE; f.newInstance(name).debug("Using Log4J as the default logging framework"); } catch (Throwable ignore2) { try { f = Log4J2LoggerFactory.INSTANCE; f.newInstance(name).debug("Using Log4J2 as the default logging framework"); } catch (Throwable ignore3) { f = JdkLoggerFactory.INSTANCE; f.newInstance(name).debug("Using java.util.logging as the default logging framework"); } } } return f; }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { InternalLoggerFactory.getInstance( SocketConnectionAttemptTest.class).warn("Unexpected exception:", cause); } }
public void retain() { if (counter.incrementAndGet() == 1) { if (instanceCounter.getAndIncrement() > 0) { InternalLogger instance = InternalLoggerFactory.getInstance(getClass()); instance.info("Initialized PauseDetectorWrapper more than once."); } pauseDetector = new SimplePauseDetector(TimeUnit.MILLISECONDS.toNanos(10), TimeUnit.MILLISECONDS.toNanos(10), 3); Runtime.getRuntime().addShutdownHook(new Thread("ShutdownHook for SimplePauseDetector") { @Override public void run() { if (pauseDetector != null) { pauseDetector.shutdown(); } } }); } }
/** * Creates a new logger instance with the name of the specified class. */ public static InternalLogger getInstance(Class<?> clazz) { return getInstance(clazz.getName()); }
/** * Returns the default factory. The initial default factory is * {@link JdkLoggerFactory}. */ public static InternalLoggerFactory getDefaultFactory() { if (defaultFactory == null) { defaultFactory = newDefaultFactory(InternalLoggerFactory.class.getName()); } return defaultFactory; }
public Http2FrameLogger(LogLevel level) { this(level.toInternalLevel(), InternalLoggerFactory.getInstance(Http2FrameLogger.class)); }
InternalLoggerFactory.getInstance(ReferenceCountedOpenSslContext.class); dhLen = Integer.valueOf(dhKeySize); } catch (NumberFormatException e) { logger.debug("ReferenceCountedOpenSslContext supports -Djdk.tls.ephemeralDHKeySize={int}, but got: " + dhKeySize);
public void start() { Configuration config = Configuration.INSTANCE; InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.INSTANCE); EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); log.info("\tStartup {}-{}-server [{}]", Constants.APP_NAME, Constants.APP_VERSION, config.getProtocol()); new Thread(() -> new UdpServer().start()).start(); ChannelFuture future = bootstrap.bind(config.getHost(), config.getPort()).sync(); future.addListener(future1 -> log.info("\tTCP listening at {}:{}...", config.getHost(), config.getPort())); future.channel().closeFuture().sync(); } catch (Exception e) { log.error("\tSocket bind failure ({})", e.getMessage()); } finally { log.info("\tShutting down and recycling...");
@SuppressWarnings("UnusedCatchParameter") private static InternalLoggerFactory newDefaultFactory(String name) { InternalLoggerFactory f; try { f = new Slf4JLoggerFactory(true); f.newInstance(name).debug("Using SLF4J as the default logging framework"); } catch (Throwable ignore1) { try { f = Log4JLoggerFactory.INSTANCE; f.newInstance(name).debug("Using Log4J as the default logging framework"); } catch (Throwable ignore2) { try { f = Log4J2LoggerFactory.INSTANCE; f.newInstance(name).debug("Using Log4J2 as the default logging framework"); } catch (Throwable ignore3) { f = JdkLoggerFactory.INSTANCE; f.newInstance(name).debug("Using java.util.logging as the default logging framework"); } } } return f; }
public void retain() { if (counter.incrementAndGet() == 1) { if (instanceCounter.getAndIncrement() > 0) { InternalLogger instance = InternalLoggerFactory.getInstance(getClass()); instance.info("Initialized PauseDetectorWrapper more than once."); } pauseDetector = new SimplePauseDetector(TimeUnit.MILLISECONDS.toNanos(10), TimeUnit.MILLISECONDS.toNanos(10), 3); Runtime.getRuntime().addShutdownHook(new Thread("ShutdownHook for SimplePauseDetector") { @Override public void run() { if (pauseDetector != null) { pauseDetector.shutdown(); } } }); } }
/** * Creates a new logger instance with the name of the specified class. */ public static InternalLogger getInstance(Class<?> clazz) { return getInstance(clazz.getName()); }
/** * Creates a new logger instance with the specified name. */ public static InternalLogger getInstance(String name) { return getDefaultFactory().newInstance(name); }
/** * Returns the default factory. The initial default factory is * {@link JdkLoggerFactory}. */ public static InternalLoggerFactory getDefaultFactory() { if (defaultFactory == null) { defaultFactory = newDefaultFactory(InternalLoggerFactory.class.getName()); } return defaultFactory; }