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


Java Slf4jLogProvider類代碼示例

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


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

示例1: dbFactory

import org.neo4j.logging.slf4j.Slf4jLogProvider; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private Block dbFactory(final Path dbdir, final String dbkey) {
  return unit -> {
    GraphDatabaseService dbservice = unit.registerMock(GraphDatabaseService.class);
    // unit.mockStatic(RuntimeRegistry.class);
    // expect(RuntimeRegistry.getStartedRuntime(dbservice)).andReturn(null);

    LinkedBindingBuilder<GraphDatabaseService> lbb = unit.mock(LinkedBindingBuilder.class);
    lbb.toInstance(dbservice);

    Binder binder = unit.get(Binder.class);
    expect(binder.bind(Key.get(GraphDatabaseService.class))).andReturn(lbb);

    ServiceKey keys = unit.get(ServiceKey.class);
    keys.generate(eq(GraphDatabaseService.class), eq(dbkey), unit.capture(Consumer.class));

    GraphDatabaseBuilder dbbuilder = unit.registerMock(GraphDatabaseBuilder.class);
    expect(dbbuilder.newGraphDatabase()).andReturn(dbservice);

    GraphDatabaseFactory factory = unit.constructor(GraphDatabaseFactory.class)
        .build();
    expect(factory.setUserLogProvider(isA(Slf4jLogProvider.class))).andReturn(factory);
    expect(factory.newEmbeddedDatabaseBuilder(dbdir.toFile())).andReturn(dbbuilder);
  };
}
 
開發者ID:jooby-project,項目名稱:jooby,代碼行數:26,代碼來源:Neo4jTest.java

示例2: newEmbeddedDb

import org.neo4j.logging.slf4j.Slf4jLogProvider; //導入依賴的package包/類
/**
 * Creates a new embedded db in the neoRepository folder.
 *
 * @param eraseExisting if true deletes previously existing db
 */
public GraphDatabaseBuilder newEmbeddedDb(File storeDir, boolean eraseExisting) {
  if (eraseExisting && storeDir.exists()) {
    // erase previous db
    LOG.debug("Removing previous neo4j database from {}", storeDir.getAbsolutePath());
    FileUtils.deleteQuietly(storeDir);
  }
  GraphDatabaseBuilder builder = new GraphDatabaseFactory()
      .setUserLogProvider(new Slf4jLogProvider())
      .newEmbeddedDatabaseBuilder(storeDir)
      .setConfig(GraphDatabaseSettings.keep_logical_logs, "false")
      .setConfig(GraphDatabaseSettings.pagecache_memory, mappedMemory + "m");
  if (shell) {
    LOG.info("Enable neo4j shell on port " + port);
    builder.setConfig(ShellSettings.remote_shell_enabled, "true")
        .setConfig(ShellSettings.remote_shell_port, String.valueOf(port))
        // listen to all IPs, not localhost only
        .setConfig(ShellSettings.remote_shell_host, "0.0.0.0");
  }
  return builder;
}
 
開發者ID:gbif,項目名稱:checklistbank,代碼行數:26,代碼來源:NeoConfiguration.java

示例3: initGraphDatabaseService

import org.neo4j.logging.slf4j.Slf4jLogProvider; //導入依賴的package包/類
protected void initGraphDatabaseService() {
  if (databasePath == null) {
    databasePath = new File(configuration.getDatabasePath());
  }
  if (graphDatabase == null) {
    if (configuration.hasHaconfig()) {
      TinkerPopConfig.HaConfig haconfig = configuration.getHaconfig();
      LOG.info(
        "Launching HA mode. Server id is " +
        haconfig.getServerId() +
        " database is at " +
        databasePath.getAbsolutePath() +
        ". allow init cluster is " +
        haconfig.allowInitCluster()
      );
      final GraphDatabaseBuilder graphDatabaseBuilder =
        new HighlyAvailableGraphDatabaseFactory()
          .setUserLogProvider(new Slf4jLogProvider())
          .newEmbeddedDatabaseBuilder(databasePath)
          .setConfig(GraphDatabaseSettings.allow_store_upgrade, "true")

          .setConfig(ClusterSettings.allow_init_cluster, haconfig.allowInitCluster())
          .setConfig(ClusterSettings.server_id, haconfig.getServerId())
          .setConfig(ClusterSettings.initial_hosts, haconfig.getInitialHosts())
          .setConfig(ClusterSettings.cluster_server, haconfig.getIp() + ":5001")
          .setConfig(HaSettings.ha_server, haconfig.getIp() + ":6001")
          /*
           * Neo4j synchronizes the slave databases via pulls of the master data. By default this property is not
           * activated (set to 0s). So this property has to be set. An alternative is to set 'ha.tx_push_factor'.
           * Since a network connection might be temporarily down, a pull is safer then a push. The push_factor is
           * meant for ensuring data duplication so that a master can safely crash
           */
          .setConfig(HaSettings.pull_interval, haconfig.getPullInterval())
          .setConfig(HaSettings.tx_push_factor, haconfig.getPushFactor());
      if (configuration.getPageCacheMemory().length() > 0) {
        graphDatabaseBuilder.setConfig(GraphDatabaseSettings.pagecache_memory, configuration.getPageCacheMemory());
      }
      graphDatabase = graphDatabaseBuilder.newGraphDatabase();
    } else {
      LOG.info("Launching local non-ha mode. Database at " + databasePath.getAbsolutePath());
      graphDatabase = new GraphDatabaseFactory()
        .setUserLogProvider( new Slf4jLogProvider() )
        .newEmbeddedDatabaseBuilder(databasePath)
        .setConfig(GraphDatabaseSettings.allow_store_upgrade, "true")
        .newGraphDatabase();
    }
  }
}
 
開發者ID:HuygensING,項目名稱:timbuctoo,代碼行數:49,代碼來源:TinkerPopGraphManager.java


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