当前位置: 首页>>代码示例>>Java>>正文


Java InternalLoggerFactory类代码示例

本文整理汇总了Java中org.jboss.netty.logging.InternalLoggerFactory的典型用法代码示例。如果您正苦于以下问题:Java InternalLoggerFactory类的具体用法?Java InternalLoggerFactory怎么用?Java InternalLoggerFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InternalLoggerFactory类属于org.jboss.netty.logging包,在下文中一共展示了InternalLoggerFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupLogger

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setupLogger(Config config) throws IOException {

        Layout layout = new PatternLayout("%d{" + DATE_FORMAT + "} %5p: %m%n");

        Appender appender = new DailyRollingFileAppender(
                layout, config.getString("logger.file"), "'.'yyyyMMdd");

        LogManager.resetConfiguration();
        LogManager.getRootLogger().addAppender(new NullAppender());

        logger = Logger.getLogger(LOGGER_NAME);
        logger.addAppender(appender);
        logger.setLevel(Level.toLevel(config.getString("logger.level"), Level.ALL));

        // Workaround for "Bug 745866 - (EDG-45) Possible netty logging config problem"
        InternalLoggerFactory.setDefaultFactory(new InternalLoggerFactory() {
            @Override
            public InternalLogger newInstance(String string) {
                return new NettyInternalLogger();
            }
        });

        Log.logSystemInfo();
        Log.info("Version: " + getAppVersion());
    }
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:26,代码来源:Log.java

示例2: setupLogger

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setupLogger(Properties properties) throws IOException {

        Layout layout = new PatternLayout("%d{yyyy-MM-dd HH:mm:ss} %5p: %m%n");

        Appender appender = new DailyRollingFileAppender(
                layout, properties.getProperty("logger.file"), "'.'yyyyMMdd");

        LogManager.resetConfiguration();
        logger = Logger.getLogger(LOGGER_NAME);
        logger.addAppender(appender);
        logger.setLevel(Level.ALL);

        // Workaround for "Bug 745866 - (EDG-45) Possible netty logging config problem"
        InternalLoggerFactory.setDefaultFactory(new InternalLoggerFactory() {
            @Override
            public InternalLogger newInstance(String string) {
                return new NettyInternalLogger();
            }
        });
    }
 
开发者ID:michaelloliveira,项目名称:traccar-mongodb,代码行数:21,代码来源:Log.java

示例3: startRpcListener

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
protected void startRpcListener() throws Exception {
    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

    ServerBootstrap bootstrap = new ServerBootstrap(
        new NioServerSocketChannelFactory(
            Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool()));

    bootstrap.setPipelineFactory(createServerPipelineFactory());
    bootstrap.setOption("child.tcpNoDelay", true);
    bootstrap.setOption("child.keepAlive", true);

    // Start listener to accept incoming connections.
    LOG.info("VistA RPC Broker starting on port {}", port);
    bootstrap.bind(new InetSocketAddress(port));
}
 
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:17,代码来源:VistaServer.java

示例4: main

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    int port = 8080;
    String filtersPath = "/Users/nbeveridge/Development/git/zuul-netty/zuul-core/src/main/filters/pre";
    if (args.length >= 2) {
        port = Integer.parseInt(args[0]);
        filtersPath = args[1];
    }

    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
    LOG.info("Starting server...");

    ZuulFiltersLoader changeNotifier = new ZuulFiltersLoader(
            Paths.get(filtersPath));
    ProxyServer proxyServer = new ProxyServer(port)
            .setFiltersChangeNotifier(changeNotifier);

    proxyServer.run().get();
    changeNotifier.reload();


    JmxReporter.startDefault(Metrics.defaultRegistry());

    //ConsoleReporter.enable(1, TimeUnit.SECONDS);
}
 
开发者ID:neilbeveridge,项目名称:zuul-netty,代码行数:25,代码来源:ProxyServer.java

示例5: run

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public void run() {

		if(instance!=null) {
			throw new IllegalStateException("An attempt has been made to start a second instance of Main");
		}
		Main.instance = this;
		
		if(conf==null) {
			conf = new File("conf");
		}
		
		System.setProperty("hypersocket.conf", conf.getPath());
		
		PropertyConfigurator.configure(new File(conf, "log4j.properties").getAbsolutePath());
		
		classLoader = getClass().getClassLoader();
		if(log.isInfoEnabled()) {
			log.info("Using class loader " + classLoader.getClass().getName());
		}
		
		InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

		try {
			createApplicationContext();

			runServer();
		} catch (Throwable e) {
			log.error("Failed to run application", e);
		}
	}
 
开发者ID:ludup,项目名称:hypersocket-framework,代码行数:31,代码来源:Main.java

示例6: init

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void init() {
    SLF4JBridgeHandler.removeHandlersForRootLogger();
    SLF4JBridgeHandler.install();
    LogManager.getLogManager().reset();
    Logger.getLogger("global").setLevel(Level.WARNING);

    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
}
 
开发者ID:RIPE-NCC,项目名称:whois,代码行数:9,代码来源:Slf4JLogConfiguration.java

示例7: start

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
@BeforeClass
public static void start() throws Exception {
    try {
        InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
        daemon = new JmxDaemon(new InetSocketAddress(jmxDaemonPort), 10);
        daemon.start();
        client = new JmxDaemonClient(new InetSocketAddress(jmxDaemonPort));
        jmxServer = creatJMXConnectorAndRMIRegistry(jmxPort);
        jmxurl = "service:jmx:rmi:///jndi/rmi://localhost:" + jmxPort + "/jmxrmi";
    } catch (Exception e) {
        e.printStackTrace();
        throw e;
    }
}
 
开发者ID:nlalevee,项目名称:jmx-daemon,代码行数:15,代码来源:JmxDaemonTest.java

示例8: setNettyLoggerFactory

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setNettyLoggerFactory() {
    InternalLoggerFactory factory = InternalLoggerFactory.getDefaultFactory();
    if (factory == null || !(factory instanceof DubboLoggerFactory)) {
        InternalLoggerFactory.setDefaultFactory(new DubboLoggerFactory());
    }
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:7,代码来源:NettyHelper.java

示例9: setNettyLoggerFactory

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setNettyLoggerFactory() {
	InternalLoggerFactory factory = InternalLoggerFactory.getDefaultFactory();
	if (null == factory) {
		InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.getDefaultFactory());
	}
}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:7,代码来源:NettyHelper.java

示例10: setupSlf4jLoggerFactory

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setupSlf4jLoggerFactory() {
    InternalLoggerFactory.setDefaultFactory(LOGGER_FACTORY);
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:4,代码来源:LoggerFactorySetup.java

示例11: setup

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
@Before
public void setup() {
  server = null;
  InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
}
 
开发者ID:DemandCube,项目名称:NeverwinterDP-Commons,代码行数:6,代码来源:NiftyServerUnitTest.java

示例12: setUp

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
@Before
public void setUp() {
    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
    createServer();
    createClient();
}
 
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:7,代码来源:VistaServiceTestSupport.java

示例13: VistaRpcComponent

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public VistaRpcComponent() {
    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
    clientPipelineFactory = new RpcClientPipelineFactory(null);
    serverPipelineFactory = new RpcServerPipelineFactory(null);
}
 
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:6,代码来源:VistaRpcComponent.java

示例14: main

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void main(String[] args) {
    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

    LOG.info("Starting mock server...");
    new MockEndpoint().run();
}
 
开发者ID:neilbeveridge,项目名称:zuul-netty,代码行数:7,代码来源:MockEndpoint.java

示例15: main

import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void main(String[] args) {
    InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

    LOG.info("Starting server...");
    new HttpServer(80).run();

    JmxReporter.startDefault(Metrics.defaultRegistry());

    //ConsoleReporter.enable(1, TimeUnit.SECONDS);
}
 
开发者ID:neilbeveridge,项目名称:zuul-netty,代码行数:11,代码来源:HttpServer.java


注:本文中的org.jboss.netty.logging.InternalLoggerFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。