當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。