本文整理汇总了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");
}
示例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);
}
}