当前位置: 首页>>代码示例>>Java>>正文


Java Log类代码示例

本文整理汇总了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();
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:11,代码来源:VaultDao.java

示例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();
}
 
开发者ID:lucasbuschlinger,项目名称:BachelorPraktikum,代码行数:16,代码来源:VaultDao.java

示例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.");
  }
}
 
开发者ID:instructure,项目名称:MinecraftLTI,代码行数:43,代码来源:MinecraftLTI.java


注:本文中的com.j256.ormlite.logger.Log类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。