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


Java ESLoggerFactory.getLogger方法代码示例

本文整理汇总了Java中org.elasticsearch.common.logging.ESLoggerFactory.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Java ESLoggerFactory.getLogger方法的具体用法?Java ESLoggerFactory.getLogger怎么用?Java ESLoggerFactory.getLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.logging.ESLoggerFactory的用法示例。


在下文中一共展示了ESLoggerFactory.getLogger方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testInvalidLenientBooleanForCurrentIndexVersion

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
@SuppressWarnings("deprecation") //#getAsBooleanLenientForPreEs6Indices is the test subject
public void testInvalidLenientBooleanForCurrentIndexVersion() {
    String falsy = randomFrom("off", "no", "0");
    String truthy = randomFrom("on", "yes", "1");

    Settings settings = Settings.builder()
        .put("foo", falsy)
        .put("bar", truthy).build();

    final DeprecationLogger deprecationLogger =
        new DeprecationLogger(ESLoggerFactory.getLogger("testInvalidLenientBooleanForCurrentIndexVersion"));
    expectThrows(IllegalArgumentException.class,
        () -> settings.getAsBooleanLenientForPreEs6Indices(Version.CURRENT, "foo", null, deprecationLogger));
    expectThrows(IllegalArgumentException.class,
        () -> settings.getAsBooleanLenientForPreEs6Indices(Version.CURRENT, "bar", null, deprecationLogger));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:SettingsTests.java

示例2: EventHookService

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
@Inject
public EventHookService(final Settings settings,
        final DynamicSettings dynamicSettings,
        final ClusterService clusterService, final Client client,
        final ScriptService scriptService, final ThreadPool threadPool) {
    super(settings);
    this.clusterService = clusterService;
    this.client = client;
    this.scriptService = scriptService;
    this.threadPool = threadPool;

    logger.info("Creating EventHookService");

    index = settings.get(CLUSTER_EVENTHOOK_INDEX, DEFAULT_EVENTHOOK_INDEX);
    eventSize = settings.getAsInt(CLUSTER_EVENTHOOK_SIZE,
            DEFAULT_EVENTHOOK_SIZE);

    final String loggerName = settings.get(CLUSTER_EVENTHOOK_LOGGER,
            DEFAULT_EVENTHOOK_LOGGER);
    scriptLogger = ESLoggerFactory.getLogger(loggerName);
}
 
开发者ID:codelibs,项目名称:elasticsearch-eventhook,代码行数:22,代码来源:EventHookService.java

示例3: BM25SimilarityProvider

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
public BM25SimilarityProvider(String name, Settings settings, Settings indexSettings) {
    super(name);
    float k1 = settings.getAsFloat("k1", 1.2f);
    float b = settings.getAsFloat("b", 0.75f);
    final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger(getClass()));
    boolean discountOverlaps =
        settings.getAsBooleanLenientForPreEs6Indices(Version.indexCreated(indexSettings), "discount_overlaps", true, deprecationLogger);

    this.similarity = new BM25Similarity(k1, b);
    this.similarity.setDiscountOverlaps(discountOverlaps);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:BM25SimilarityProvider.java

示例4: createCodecService

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
private CodecService createCodecService() throws IOException {
    Settings nodeSettings = Settings.builder()
            .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
            .build();
    IndexSettings settings = IndexSettingsModule.newIndexSettings("_na", nodeSettings);
    SimilarityService similarityService = new SimilarityService(settings, Collections.emptyMap());
    IndexAnalyzers indexAnalyzers = createTestAnalysis(settings, nodeSettings).indexAnalyzers;
    MapperRegistry mapperRegistry = new MapperRegistry(Collections.emptyMap(), Collections.emptyMap());
    MapperService service = new MapperService(settings, indexAnalyzers, xContentRegistry(), similarityService, mapperRegistry,
            () -> null);
    return new CodecService(service, ESLoggerFactory.getLogger("test"));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:CodecTests.java

示例5: testLenientBooleanForPreEs6Index

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
@SuppressWarnings("deprecation") //#getAsBooleanLenientForPreEs6Indices is the test subject
public void testLenientBooleanForPreEs6Index() throws IOException {
    // time to say goodbye?
    assertTrue(
        "It's time to implement #22298. Please delete this test and Settings#getAsBooleanLenientForPreEs6Indices().",
        Version.CURRENT.minimumCompatibilityVersion().before(Version.V_6_0_0_alpha1_UNRELEASED));


    String falsy = randomFrom("false", "off", "no", "0");
    String truthy = randomFrom("true", "on", "yes", "1");

    Settings settings = Settings.builder()
        .put("foo", falsy)
        .put("bar", truthy).build();

    final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("testLenientBooleanForPreEs6Index"));

    assertFalse(settings.getAsBooleanLenientForPreEs6Indices(Version.V_5_0_0, "foo", null, deprecationLogger));
    assertTrue(settings.getAsBooleanLenientForPreEs6Indices(Version.V_5_0_0, "bar", null, deprecationLogger));
    assertTrue(settings.getAsBooleanLenientForPreEs6Indices(Version.V_5_0_0, "baz", true, deprecationLogger));

    List<String> expectedDeprecationWarnings = new ArrayList<>();
    if (Booleans.isBoolean(falsy) == false) {
        expectedDeprecationWarnings.add(
            "The value [" + falsy + "] of setting [foo] is not coerced into boolean anymore. Please change this value to [false].");
    }
    if (Booleans.isBoolean(truthy) == false) {
        expectedDeprecationWarnings.add(
            "The value [" + truthy + "] of setting [bar] is not coerced into boolean anymore. Please change this value to [true].");
    }

    if (expectedDeprecationWarnings.isEmpty() == false) {
        assertWarnings(expectedDeprecationWarnings.toArray(new String[1]));
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:36,代码来源:SettingsTests.java

示例6: testValidLenientBooleanForCurrentIndexVersion

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
@SuppressWarnings("deprecation") //#getAsBooleanLenientForPreEs6Indices is the test subject
public void testValidLenientBooleanForCurrentIndexVersion() {
    Settings settings = Settings.builder()
        .put("foo", "false")
        .put("bar", "true").build();

    final DeprecationLogger deprecationLogger =
        new DeprecationLogger(ESLoggerFactory.getLogger("testValidLenientBooleanForCurrentIndexVersion"));
    assertFalse(settings.getAsBooleanLenientForPreEs6Indices(Version.CURRENT, "foo", null, deprecationLogger));
    assertTrue(settings.getAsBooleanLenientForPreEs6Indices(Version.CURRENT, "bar", null, deprecationLogger));
    assertTrue(settings.getAsBooleanLenientForPreEs6Indices(Version.CURRENT, "baz", true, deprecationLogger));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:SettingsTests.java

示例7: LdapLoginSource

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
public LdapLoginSource(Map<String, Object> settings, String masterUser, String masterPassword) {
fUserNames = new ArrayList<>();
fUserPasswords = new ArrayList<>();

fMasterUser = masterUser;
fMasterPassword = masterPassword;

String url = XContentMapValues.nodeStringValue(settings.get("ldap_url"), null);
String base = XContentMapValues.nodeStringValue(settings.get("ldap_base"), null);
String user = XContentMapValues.nodeStringValue(settings.get("ldap_user"), null);
String password = XContentMapValues.nodeStringValue(settings.get("ldap_password"), null);

fConnector = new SimpleLdapConnector(url, base, user, password, true);

fNameField = XContentMapValues.nodeStringValue(settings.get("ldap_name_field"), DEF_USER_NAME_FIELD);
fPasswordField = XContentMapValues.nodeStringValue(settings.get("ldap_password_field"), DEF_USER_PW_FIELD);
fLdapFilter = fNameField + "=*";

fLogger = ESLoggerFactory.getLogger(LdapLoginSource.class.getName());

fLock = new Object();
fInitialized = false;

//start refreshing thread once initialized; interval in minutes
String refreshParam = XContentMapValues.nodeStringValue(settings.get("ldap_refresh_interval"), DEF_REFRESH_INT);
fRefreshInt = Long.parseLong(refreshParam) * 60000L;
if(fRefreshInt > 0) {
    //TODO: actually stop refreshing thread somehow
    fActive = true;
    Thread t = new Thread(this);
    t.setDaemon(true);
    t.start();
}
   }
 
开发者ID:salyh,项目名称:elasticsearch-imap,代码行数:35,代码来源:LdapLoginSource.java

示例8: BenzLogger

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
public BenzLogger(String name) {
    logger = ESLoggerFactory.getLogger(name);
}
 
开发者ID:wxingyl,项目名称:elasticsearch-analysis-benz,代码行数:4,代码来源:BenzLogger.java

示例9: RestLoggerFilter

import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
public RestLoggerFilter(Settings settings) {
  log = ESLoggerFactory.getLogger(settings.get("restlog.category", "restlog"));
  pathFilter = pathFilter(settings.get("restlog.path_regex", ""));
  contentEncoder = encoder(settings.get("restlog.content_encoding", "json"));
  joiner = Joiner.on(" ").useForNull(settings.get("restlog.null_value", "-"));
}
 
开发者ID:etsy,项目名称:es-restlog,代码行数:7,代码来源:RestLoggerFilter.java


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