本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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"));
}
示例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]));
}
}
示例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));
}
示例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();
}
}
示例8: BenzLogger
import org.elasticsearch.common.logging.ESLoggerFactory; //导入方法依赖的package包/类
public BenzLogger(String name) {
logger = ESLoggerFactory.getLogger(name);
}
示例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", "-"));
}