本文整理汇总了Java中com.j256.ormlite.logger.Log类的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Log类属于com.j256.ormlite.logger包,在下文中一共展示了Log类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeDb
import com.j256.ormlite.logger.Log; //导入依赖的package包/类
public static void initializeDb() throws SQLException {
//TODO combine logging
System.setProperty(LoggerFactory.LOG_TYPE_SYSTEM_PROPERTY,
LoggerFactory.LogType.LOCAL.toString());
System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY,
Log.Level.INFO.toString());
INSTANCE = new VaultDao();
INSTANCE.initDb();
}
示例2: initializeDb
import com.j256.ormlite.logger.Log; //导入依赖的package包/类
/**
* Initializes the connection to the database and sets up the Vault Database Access Object {@link #INSTANCE}.
*
* @throws SQLException Thrown if the database can not be successfully initialized.
*/
public static void initializeDb() throws SQLException {
//TODO combine logging
System.setProperty(LoggerFactory.LOG_TYPE_SYSTEM_PROPERTY,
LoggerFactory.LogType.LOCAL.toString());
System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY,
Log.Level.INFO.toString());
INSTANCE = new VaultDao();
INSTANCE.initDb();
}
示例3: startWebserver
import com.j256.ormlite.logger.Log; //导入依赖的package包/类
private void startWebserver() {
JSONObject config = getConfig();
webport = Integer.parseInt((String)config.get("port"));
org.eclipse.jetty.util.log.Log.setLog(new NullLogger());
webserver = new Server(webport);
webserver.setSessionIdManager(new HashSessionIdManager());
RewriteHandler rewriteHandler = new RewriteHandler();
rewriteHandler.setRewriteRequestURI(true);
rewriteHandler.setRewritePathInfo(true);
rewriteHandler.setOriginalPathAttribute("requestedPath");
RedirectRegexRule rule = new RedirectRegexRule();
rule.setRegex("/");
rule.setReplacement("/index");
rewriteHandler.addRule(rule);
WebAppContext dynamicHandler = new WebAppContext();
String webDir = this.getClass().getClassLoader().getResource("web").toExternalForm();
dynamicHandler.setResourceBase(webDir);
dynamicHandler.addServlet(new ServletHolder(new IndexServlet(this)),"/index");
dynamicHandler.addServlet(new ServletHolder(new LTIServlet(this)),"/lti");
dynamicHandler.addServlet(new ServletHolder(new TokenServlet(this)),"/token");
dynamicHandler.addServlet(new ServletHolder(new AssignmentServlet(this)),"/assignment");
dynamicHandler.addServlet(new ServletHolder(new ConsumerServlet(this)),"/consumer");
dynamicHandler.addServlet(new ServletHolder(new LTIConfigServlet()),"/config.xml");
ResourceHandler staticHandler = new ResourceHandler();
String staticDir = this.getClass().getClassLoader().getResource("static").toExternalForm();
staticHandler.setResourceBase(staticDir);
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[] { rewriteHandler, staticHandler, dynamicHandler, new DefaultHandler() });
webserver.setHandler(handlers);
try {
webserver.start();
} catch (Exception e) {
getLogger().severe("Failed to start server.");
}
}