本文整理汇总了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());
}
示例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();
}
});
}
示例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));
}
示例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);
}
示例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);
}
}
示例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());
}
示例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;
}
}
示例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());
}
}
示例9: setNettyLoggerFactory
import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setNettyLoggerFactory() {
InternalLoggerFactory factory = InternalLoggerFactory.getDefaultFactory();
if (null == factory) {
InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.getDefaultFactory());
}
}
示例10: setupSlf4jLoggerFactory
import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public static void setupSlf4jLoggerFactory() {
InternalLoggerFactory.setDefaultFactory(LOGGER_FACTORY);
}
示例11: setup
import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
@Before
public void setup() {
server = null;
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
}
示例12: setUp
import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
@Before
public void setUp() {
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
createServer();
createClient();
}
示例13: VistaRpcComponent
import org.jboss.netty.logging.InternalLoggerFactory; //导入依赖的package包/类
public VistaRpcComponent() {
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
clientPipelineFactory = new RpcClientPipelineFactory(null);
serverPipelineFactory = new RpcServerPipelineFactory(null);
}
示例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();
}
示例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);
}