當前位置: 首頁>>代碼示例>>Java>>正文


Java Slf4jLog類代碼示例

本文整理匯總了Java中org.mortbay.log.Slf4jLog的典型用法代碼示例。如果您正苦於以下問題:Java Slf4jLog類的具體用法?Java Slf4jLog怎麽用?Java Slf4jLog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Slf4jLog類屬於org.mortbay.log包,在下文中一共展示了Slf4jLog類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureLogging

import org.mortbay.log.Slf4jLog; //導入依賴的package包/類
private static void configureLogging() {
  // Configure commons logging to log to the Swing log panel logger
  LogFactory.getFactory().setAttribute(JCL_LOG_CONFIG_ATTR, LogPanelLog.class.getName());
  // Configure Jetty to log to SLF4J. Since slf4j-jcl.jar is in the classpath, SLF4J will be
  // configured to delegate logging to commons logging.
  System.setProperty(JETTY_LOG_CLASS_PROP, Slf4jLog.class.getName());
  System.setProperty(JCL_SIMPLELOG_SHOW_SHORT_LOGNAME, "false");
  System.setProperty(JCL_SIMPLELOG_SHOWLOGNAME, "false");
}
 
開發者ID:BladeRunnerJS,項目名稱:brjs-JsTestDriver,代碼行數:10,代碼來源:MainUI.java

示例2: main

import org.mortbay.log.Slf4jLog; //導入依賴的package包/類
public static void main(String[] args) throws Exception {
	System.setProperty("org.mortbay.log.class", Slf4jLog.class.getName());
	
	File log4jConfigFile = new File("log4j.xml");
	
	if (log4jConfigFile.exists()) {
		DOMConfigurator.configureAndWatch(log4jConfigFile.getAbsolutePath(), 1000);
	}
	else {
		BasicConfigurator.configure();
		Logger.getRootLogger().setLevel(Level.INFO);
	}

	
	ServerConfiguration config;
	
	JAXBContext context = JAXBContext.newInstance(
									ServerConfiguration.class, 
									
									VeracityId.class,
									SimpleId.class,
									
									PasswordProofRecipie.class,
									ProofDelegationRecipie.class
									);
	
	JAXBHelper helper = new JAXBHelper(context);
	
	Logger log = Logger.getLogger(AppkeepServer.class);
	
	File configFile = new File("settings.xml");
	if(!configFile.exists())
		configFile = new File(new File(System.getProperty("user.dir")), ".appkeep-server.xml");
	if(!configFile.exists())
		configFile = new File("/etc/appkeep-server.xml");
	
	if(!configFile.exists()){
		config = new ServerConfiguration();
		helper.writeToFile(helper.writeToXmlString(config), configFile);
		log.warn("Created default config file at " + configFile.getAbsolutePath());
	}else{
		log.info("Reading configuration from " + configFile.getAbsolutePath());
		config = helper.readFromFile(configFile);
	}

	ProxyFactory proxyFactory = new ProxyFactory(new HessianProxyProvider());
	try {
		new AppkeepServer(config, proxyFactory);
	} catch (Exception e) {
		e.printStackTrace();
		System.out.println("Unexpected Error.  Shutting Down.");
		System.exit(1);
	}
}
 
開發者ID:mosscode,項目名稱:appkeep,代碼行數:55,代碼來源:AppkeepServer.java


注:本文中的org.mortbay.log.Slf4jLog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。