Logging: Make ESLoggerFactory package private (#34199)
Since all calls to `ESLoggerFactory` outside of the logging package were deprecated, it seemed like it'd simplify things to migrate all of the deprecated calls and declare `ESLoggerFactory` to be package private. This does that.
This commit is contained in:
parent
c6c83d19f7
commit
06993e0c35
|
@ -23,10 +23,10 @@ import com.github.mustachejava.MustacheException;
|
||||||
import com.github.mustachejava.MustacheFactory;
|
import com.github.mustachejava.MustacheFactory;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.logging.log4j.util.Supplier;
|
import org.apache.logging.log4j.util.Supplier;
|
||||||
import org.elasticsearch.SpecialPermission;
|
import org.elasticsearch.SpecialPermission;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.script.GeneralScriptException;
|
import org.elasticsearch.script.GeneralScriptException;
|
||||||
import org.elasticsearch.script.Script;
|
import org.elasticsearch.script.Script;
|
||||||
import org.elasticsearch.script.ScriptContext;
|
import org.elasticsearch.script.ScriptContext;
|
||||||
|
@ -51,7 +51,7 @@ import java.util.Map;
|
||||||
* {@link Mustache} object can then be re-used for subsequent executions.
|
* {@link Mustache} object can then be re-used for subsequent executions.
|
||||||
*/
|
*/
|
||||||
public final class MustacheScriptEngine implements ScriptEngine {
|
public final class MustacheScriptEngine implements ScriptEngine {
|
||||||
private static final Logger logger = ESLoggerFactory.getLogger(MustacheScriptEngine.class);
|
private static final Logger logger = LogManager.getLogger(MustacheScriptEngine.class);
|
||||||
|
|
||||||
public static final String NAME = "mustache";
|
public static final String NAME = "mustache";
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
package org.elasticsearch.painless;
|
package org.elasticsearch.painless;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.core.internal.io.IOUtils;
|
import org.elasticsearch.core.internal.io.IOUtils;
|
||||||
import org.elasticsearch.painless.lookup.PainlessClass;
|
import org.elasticsearch.painless.lookup.PainlessClass;
|
||||||
import org.elasticsearch.painless.lookup.PainlessConstructor;
|
import org.elasticsearch.painless.lookup.PainlessConstructor;
|
||||||
|
@ -55,7 +55,7 @@ import static java.util.Comparator.comparing;
|
||||||
public class PainlessDocGenerator {
|
public class PainlessDocGenerator {
|
||||||
|
|
||||||
private static final PainlessLookup PAINLESS_LOOKUP = PainlessLookupBuilder.buildFromWhitelists(Whitelist.BASE_WHITELISTS);
|
private static final PainlessLookup PAINLESS_LOOKUP = PainlessLookupBuilder.buildFromWhitelists(Whitelist.BASE_WHITELISTS);
|
||||||
private static final Logger logger = ESLoggerFactory.getLogger(PainlessDocGenerator.class);
|
private static final Logger logger = LogManager.getLogger(PainlessDocGenerator.class);
|
||||||
private static final Comparator<PainlessField> FIELD_NAME = comparing(f -> f.javaField.getName());
|
private static final Comparator<PainlessField> FIELD_NAME = comparing(f -> f.javaField.getName());
|
||||||
private static final Comparator<PainlessMethod> METHOD_NAME = comparing(m -> m.javaMethod.getName());
|
private static final Comparator<PainlessMethod> METHOD_NAME = comparing(m -> m.javaMethod.getName());
|
||||||
private static final Comparator<PainlessMethod> METHOD_NUMBER_OF_PARAMS = comparing(m -> m.typeParameters.size());
|
private static final Comparator<PainlessMethod> METHOD_NUMBER_OF_PARAMS = comparing(m -> m.typeParameters.size());
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.action;
|
package org.elasticsearch.action;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainAction;
|
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainAction;
|
||||||
import org.elasticsearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction;
|
import org.elasticsearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction;
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthAction;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthAction;
|
||||||
|
@ -200,7 +201,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
import org.elasticsearch.common.NamedRegistry;
|
import org.elasticsearch.common.NamedRegistry;
|
||||||
import org.elasticsearch.common.inject.AbstractModule;
|
import org.elasticsearch.common.inject.AbstractModule;
|
||||||
import org.elasticsearch.common.inject.multibindings.MapBinder;
|
import org.elasticsearch.common.inject.multibindings.MapBinder;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.ClusterSettings;
|
import org.elasticsearch.common.settings.ClusterSettings;
|
||||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -336,7 +336,7 @@ import static java.util.Collections.unmodifiableMap;
|
||||||
*/
|
*/
|
||||||
public class ActionModule extends AbstractModule {
|
public class ActionModule extends AbstractModule {
|
||||||
|
|
||||||
private static final Logger logger = ESLoggerFactory.getLogger(ActionModule.class);
|
private static final Logger logger = LogManager.getLogger(ActionModule.class);
|
||||||
|
|
||||||
private final boolean transportClient;
|
private final boolean transportClient;
|
||||||
private final Settings settings;
|
private final Settings settings;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.action.bulk;
|
package org.elasticsearch.action.bulk;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.action.DocWriteRequest;
|
import org.elasticsearch.action.DocWriteRequest;
|
||||||
|
@ -48,7 +49,6 @@ import org.elasticsearch.common.CheckedSupplier;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.collect.Tuple;
|
import org.elasticsearch.common.collect.Tuple;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||||
|
@ -80,7 +80,7 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
|
||||||
|
|
||||||
public static final String ACTION_NAME = BulkAction.NAME + "[s]";
|
public static final String ACTION_NAME = BulkAction.NAME + "[s]";
|
||||||
|
|
||||||
private static final Logger logger = ESLoggerFactory.getLogger(TransportShardBulkAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportShardBulkAction.class);
|
||||||
|
|
||||||
private final ThreadPool threadPool;
|
private final ThreadPool threadPool;
|
||||||
private final UpdateHelper updateHelper;
|
private final UpdateHelper updateHelper;
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package org.elasticsearch.bootstrap;
|
package org.elasticsearch.bootstrap;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.core.Appender;
|
import org.apache.logging.log4j.core.Appender;
|
||||||
import org.apache.logging.log4j.core.LoggerContext;
|
import org.apache.logging.log4j.core.LoggerContext;
|
||||||
import org.apache.logging.log4j.core.appender.ConsoleAppender;
|
import org.apache.logging.log4j.core.appender.ConsoleAppender;
|
||||||
|
@ -34,7 +34,6 @@ import org.elasticsearch.cli.UserException;
|
||||||
import org.elasticsearch.common.PidFile;
|
import org.elasticsearch.common.PidFile;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.inject.CreationException;
|
import org.elasticsearch.common.inject.CreationException;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.logging.LogConfigurator;
|
import org.elasticsearch.common.logging.LogConfigurator;
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.network.IfConfig;
|
import org.elasticsearch.common.network.IfConfig;
|
||||||
|
@ -193,7 +192,7 @@ final class Bootstrap {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// look for jar hell
|
// look for jar hell
|
||||||
final Logger logger = ESLoggerFactory.getLogger(JarHell.class);
|
final Logger logger = LogManager.getLogger(JarHell.class);
|
||||||
JarHell.checkJarHell(logger::debug);
|
JarHell.checkJarHell(logger::debug);
|
||||||
} catch (IOException | URISyntaxException e) {
|
} catch (IOException | URISyntaxException e) {
|
||||||
throw new BootstrapException(e);
|
throw new BootstrapException(e);
|
||||||
|
|
|
@ -26,17 +26,17 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
|
||||||
/**
|
/**
|
||||||
* Factory to get {@link Logger}s
|
* Factory to get {@link Logger}s
|
||||||
*/
|
*/
|
||||||
public final class ESLoggerFactory {
|
final class ESLoggerFactory {
|
||||||
|
|
||||||
private ESLoggerFactory() {
|
private ESLoggerFactory() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Logger getLogger(String prefix, String name) {
|
static Logger getLogger(String prefix, String name) {
|
||||||
return getLogger(prefix, LogManager.getLogger(name));
|
return getLogger(prefix, LogManager.getLogger(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Logger getLogger(String prefix, Class<?> clazz) {
|
static Logger getLogger(String prefix, Class<?> clazz) {
|
||||||
/*
|
/*
|
||||||
* At one point we didn't use LogManager.getLogger(clazz) because
|
* At one point we didn't use LogManager.getLogger(clazz) because
|
||||||
* of a bug in log4j that has since been fixed:
|
* of a bug in log4j that has since been fixed:
|
||||||
|
@ -49,7 +49,7 @@ public final class ESLoggerFactory {
|
||||||
return getLogger(prefix, LogManager.getLogger(clazz.getName()));
|
return getLogger(prefix, LogManager.getLogger(clazz.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Logger getLogger(String prefix, Logger logger) {
|
static Logger getLogger(String prefix, Logger logger) {
|
||||||
/*
|
/*
|
||||||
* In a followup we'll throw an exception if prefix is null or empty
|
* In a followup we'll throw an exception if prefix is null or empty
|
||||||
* redirecting folks to LogManager.getLogger.
|
* redirecting folks to LogManager.getLogger.
|
||||||
|
@ -61,13 +61,4 @@ public final class ESLoggerFactory {
|
||||||
}
|
}
|
||||||
return new PrefixLogger((ExtendedLogger)logger, logger.getName(), prefix);
|
return new PrefixLogger((ExtendedLogger)logger, logger.getName(), prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get or build a logger.
|
|
||||||
* @deprecated Prefer {@link LogManager#getLogger}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static Logger getLogger(Class<?> clazz) {
|
|
||||||
return getLogger(null, clazz);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class Loggers {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static Logger getLogger(Class<?> clazz) {
|
public static Logger getLogger(Class<?> clazz) {
|
||||||
return ESLoggerFactory.getLogger(clazz);
|
return ESLoggerFactory.getLogger(null, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String formatPrefix(String... prefixes) {
|
private static String formatPrefix(String... prefixes) {
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
package org.elasticsearch.common.util.concurrent;
|
package org.elasticsearch.common.util.concurrent;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.elasticsearch.common.ExponentiallyWeightedMovingAverage;
|
import org.elasticsearch.common.ExponentiallyWeightedMovingAverage;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -41,8 +41,7 @@ public final class QueueResizingEsThreadPoolExecutor extends EsThreadPoolExecuto
|
||||||
// This is a random starting point alpha. TODO: revisit this with actual testing and/or make it configurable
|
// This is a random starting point alpha. TODO: revisit this with actual testing and/or make it configurable
|
||||||
public static double EWMA_ALPHA = 0.3;
|
public static double EWMA_ALPHA = 0.3;
|
||||||
|
|
||||||
private static final Logger logger =
|
private static final Logger logger = LogManager.getLogger(QueueResizingEsThreadPoolExecutor.class);
|
||||||
ESLoggerFactory.getLogger(QueueResizingEsThreadPoolExecutor.class);
|
|
||||||
// The amount the queue size is adjusted by for each calcuation
|
// The amount the queue size is adjusted by for each calcuation
|
||||||
private static final int QUEUE_ADJUSTMENT_AMOUNT = 50;
|
private static final int QUEUE_ADJUSTMENT_AMOUNT = 50;
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,13 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.common.util.concurrent;
|
package org.elasticsearch.common.util.concurrent;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.util.CloseableThreadLocal;
|
import org.apache.lucene.util.CloseableThreadLocal;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Setting.Property;
|
import org.elasticsearch.common.settings.Setting.Property;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -83,6 +84,7 @@ public final class ThreadContext implements Closeable, Writeable {
|
||||||
|
|
||||||
public static final String PREFIX = "request.headers";
|
public static final String PREFIX = "request.headers";
|
||||||
public static final Setting<Settings> DEFAULT_HEADERS_SETTING = Setting.groupSetting(PREFIX + ".", Property.NodeScope);
|
public static final Setting<Settings> DEFAULT_HEADERS_SETTING = Setting.groupSetting(PREFIX + ".", Property.NodeScope);
|
||||||
|
private static final Logger logger = LogManager.getLogger(ThreadContext.class);
|
||||||
private static final ThreadContextStruct DEFAULT_CONTEXT = new ThreadContextStruct();
|
private static final ThreadContextStruct DEFAULT_CONTEXT = new ThreadContextStruct();
|
||||||
private final Map<String, String> defaultHeader;
|
private final Map<String, String> defaultHeader;
|
||||||
private final ContextThreadLocal threadLocal;
|
private final ContextThreadLocal threadLocal;
|
||||||
|
@ -469,18 +471,16 @@ public final class ThreadContext implements Closeable, Writeable {
|
||||||
//check if we can add another warning header - if max size within limits
|
//check if we can add another warning header - if max size within limits
|
||||||
if (key.equals("Warning") && (maxWarningHeaderSize != -1)) { //if size is NOT unbounded, check its limits
|
if (key.equals("Warning") && (maxWarningHeaderSize != -1)) { //if size is NOT unbounded, check its limits
|
||||||
if (warningHeadersSize > maxWarningHeaderSize) { // if max size has already been reached before
|
if (warningHeadersSize > maxWarningHeaderSize) { // if max size has already been reached before
|
||||||
final String message = "Dropping a warning header, as their total size reached the maximum allowed of [" +
|
logger.warn("Dropping a warning header, as their total size reached the maximum allowed of ["
|
||||||
maxWarningHeaderSize + "] bytes set in [" +
|
+ maxWarningHeaderSize + "] bytes set in ["
|
||||||
HttpTransportSettings.SETTING_HTTP_MAX_WARNING_HEADER_SIZE.getKey() + "]!";
|
+ HttpTransportSettings.SETTING_HTTP_MAX_WARNING_HEADER_SIZE.getKey() + "]!");
|
||||||
ESLoggerFactory.getLogger(ThreadContext.class).warn(message);
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
newWarningHeaderSize += "Warning".getBytes(StandardCharsets.UTF_8).length + value.getBytes(StandardCharsets.UTF_8).length;
|
newWarningHeaderSize += "Warning".getBytes(StandardCharsets.UTF_8).length + value.getBytes(StandardCharsets.UTF_8).length;
|
||||||
if (newWarningHeaderSize > maxWarningHeaderSize) {
|
if (newWarningHeaderSize > maxWarningHeaderSize) {
|
||||||
final String message = "Dropping a warning header, as their total size reached the maximum allowed of [" +
|
logger.warn("Dropping a warning header, as their total size reached the maximum allowed of ["
|
||||||
maxWarningHeaderSize + "] bytes set in [" +
|
+ maxWarningHeaderSize + "] bytes set in ["
|
||||||
HttpTransportSettings.SETTING_HTTP_MAX_WARNING_HEADER_SIZE.getKey() + "]!";
|
+ HttpTransportSettings.SETTING_HTTP_MAX_WARNING_HEADER_SIZE.getKey() + "]!");
|
||||||
ESLoggerFactory.getLogger(ThreadContext.class).warn(message);
|
|
||||||
return new ThreadContextStruct(requestHeaders, responseHeaders, transientHeaders, isSystemContext, newWarningHeaderSize);
|
return new ThreadContextStruct(requestHeaders, responseHeaders, transientHeaders, isSystemContext, newWarningHeaderSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -505,9 +505,9 @@ public final class ThreadContext implements Closeable, Writeable {
|
||||||
if ((key.equals("Warning")) && (maxWarningHeaderCount != -1)) { //if count is NOT unbounded, check its limits
|
if ((key.equals("Warning")) && (maxWarningHeaderCount != -1)) { //if count is NOT unbounded, check its limits
|
||||||
final int warningHeaderCount = newResponseHeaders.containsKey("Warning") ? newResponseHeaders.get("Warning").size() : 0;
|
final int warningHeaderCount = newResponseHeaders.containsKey("Warning") ? newResponseHeaders.get("Warning").size() : 0;
|
||||||
if (warningHeaderCount > maxWarningHeaderCount) {
|
if (warningHeaderCount > maxWarningHeaderCount) {
|
||||||
final String message = "Dropping a warning header, as their total count reached the maximum allowed of [" +
|
logger.warn("Dropping a warning header, as their total count reached the maximum allowed of ["
|
||||||
maxWarningHeaderCount + "] set in [" + HttpTransportSettings.SETTING_HTTP_MAX_WARNING_HEADER_COUNT.getKey() + "]!";
|
+ maxWarningHeaderCount + "] set in ["
|
||||||
ESLoggerFactory.getLogger(ThreadContext.class).warn(message);
|
+ HttpTransportSettings.SETTING_HTTP_MAX_WARNING_HEADER_COUNT.getKey() + "]!");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,7 @@ public final class ThreadContext implements Closeable, Writeable {
|
||||||
assert e instanceof CancellationException
|
assert e instanceof CancellationException
|
||||||
|| e instanceof InterruptedException
|
|| e instanceof InterruptedException
|
||||||
|| e instanceof ExecutionException : e;
|
|| e instanceof ExecutionException : e;
|
||||||
final Optional<Error> maybeError = ExceptionsHelper.maybeError(e, ESLoggerFactory.getLogger(ThreadContext.class));
|
final Optional<Error> maybeError = ExceptionsHelper.maybeError(e, logger);
|
||||||
if (maybeError.isPresent()) {
|
if (maybeError.isPresent()) {
|
||||||
// throw this error where it will propagate to the uncaught exception handler
|
// throw this error where it will propagate to the uncaught exception handler
|
||||||
throw maybeError.get();
|
throw maybeError.get();
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
|
|
||||||
package org.elasticsearch.index.mapper;
|
package org.elasticsearch.index.mapper;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.document.Field;
|
import org.apache.lucene.document.Field;
|
||||||
import org.apache.lucene.index.IndexOptions;
|
import org.apache.lucene.index.IndexOptions;
|
||||||
import org.apache.lucene.index.IndexableField;
|
import org.apache.lucene.index.IndexableField;
|
||||||
import org.apache.lucene.search.Query;
|
import org.apache.lucene.search.Query;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.lucene.Lucene;
|
import org.elasticsearch.common.lucene.Lucene;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
@ -49,7 +49,7 @@ import java.util.Objects;
|
||||||
public class FieldNamesFieldMapper extends MetadataFieldMapper {
|
public class FieldNamesFieldMapper extends MetadataFieldMapper {
|
||||||
|
|
||||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
||||||
ESLoggerFactory.getLogger(FieldNamesFieldMapper.class));
|
LogManager.getLogger(FieldNamesFieldMapper.class));
|
||||||
|
|
||||||
public static final String NAME = "_field_names";
|
public static final String NAME = "_field_names";
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.index.mapper;
|
package org.elasticsearch.index.mapper;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.index.Term;
|
import org.apache.lucene.index.Term;
|
||||||
import org.apache.lucene.search.Query;
|
import org.apache.lucene.search.Query;
|
||||||
import org.apache.lucene.search.TermQuery;
|
import org.apache.lucene.search.TermQuery;
|
||||||
|
@ -27,7 +28,6 @@ import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.collect.CopyOnWriteHashMap;
|
import org.elasticsearch.common.collect.CopyOnWriteHashMap;
|
||||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
@ -45,7 +45,7 @@ import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ObjectMapper extends Mapper implements Cloneable {
|
public class ObjectMapper extends Mapper implements Cloneable {
|
||||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger(ObjectMapper.class));
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ObjectMapper.class));
|
||||||
|
|
||||||
public static final String CONTENT_TYPE = "object";
|
public static final String CONTENT_TYPE = "object";
|
||||||
public static final String NESTED_CONTENT_TYPE = "nested";
|
public static final String NESTED_CONTENT_TYPE = "nested";
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.index.mapper;
|
package org.elasticsearch.index.mapper;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.document.Field;
|
import org.apache.lucene.document.Field;
|
||||||
import org.apache.lucene.document.SortedSetDocValuesField;
|
import org.apache.lucene.document.SortedSetDocValuesField;
|
||||||
import org.apache.lucene.index.IndexOptions;
|
import org.apache.lucene.index.IndexOptions;
|
||||||
|
@ -36,7 +37,6 @@ import org.apache.lucene.search.TermInSetQuery;
|
||||||
import org.apache.lucene.search.TermQuery;
|
import org.apache.lucene.search.TermQuery;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.lucene.Lucene;
|
import org.elasticsearch.common.lucene.Lucene;
|
||||||
import org.elasticsearch.common.lucene.search.Queries;
|
import org.elasticsearch.common.lucene.search.Queries;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
@ -92,7 +92,7 @@ public class TypeFieldMapper extends MetadataFieldMapper {
|
||||||
|
|
||||||
static final class TypeFieldType extends StringFieldType {
|
static final class TypeFieldType extends StringFieldType {
|
||||||
|
|
||||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(ESLoggerFactory.getLogger(TypeFieldType.class));
|
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TypeFieldType.class));
|
||||||
|
|
||||||
TypeFieldType() {
|
TypeFieldType() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
package org.elasticsearch.monitor.os;
|
package org.elasticsearch.monitor.os;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.util.Constants;
|
import org.apache.lucene.util.Constants;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.monitor.Probes;
|
import org.elasticsearch.monitor.Probes;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -517,7 +517,7 @@ public class OsProbe {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Logger logger = ESLoggerFactory.getLogger(getClass());
|
private final Logger logger = LogManager.getLogger(getClass());
|
||||||
|
|
||||||
public OsInfo osInfo(long refreshInterval, int allocatedProcessors) {
|
public OsInfo osInfo(long refreshInterval, int allocatedProcessors) {
|
||||||
return new OsInfo(refreshInterval, Runtime.getRuntime().availableProcessors(),
|
return new OsInfo(refreshInterval, Runtime.getRuntime().availableProcessors(),
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.plugins;
|
package org.elasticsearch.plugins;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.analysis.util.CharFilterFactory;
|
import org.apache.lucene.analysis.util.CharFilterFactory;
|
||||||
import org.apache.lucene.analysis.util.TokenFilterFactory;
|
import org.apache.lucene.analysis.util.TokenFilterFactory;
|
||||||
import org.apache.lucene.analysis.util.TokenizerFactory;
|
import org.apache.lucene.analysis.util.TokenizerFactory;
|
||||||
|
@ -36,7 +37,6 @@ import org.elasticsearch.common.component.AbstractComponent;
|
||||||
import org.elasticsearch.common.component.LifecycleComponent;
|
import org.elasticsearch.common.component.LifecycleComponent;
|
||||||
import org.elasticsearch.common.inject.Module;
|
import org.elasticsearch.common.inject.Module;
|
||||||
import org.elasticsearch.common.io.FileSystemUtils;
|
import org.elasticsearch.common.io.FileSystemUtils;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Setting.Property;
|
import org.elasticsearch.common.settings.Setting.Property;
|
||||||
|
@ -475,7 +475,7 @@ public class PluginsService extends AbstractComponent {
|
||||||
List<String> exts = bundle.plugin.getExtendedPlugins();
|
List<String> exts = bundle.plugin.getExtendedPlugins();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final Logger logger = ESLoggerFactory.getLogger(JarHell.class);
|
final Logger logger = LogManager.getLogger(JarHell.class);
|
||||||
Set<URL> urls = new HashSet<>();
|
Set<URL> urls = new HashSet<>();
|
||||||
for (String extendedPlugin : exts) {
|
for (String extendedPlugin : exts) {
|
||||||
Set<URL> pluginUrls = transitiveUrls.get(extendedPlugin);
|
Set<URL> pluginUrls = transitiveUrls.get(extendedPlugin);
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
|
|
||||||
package org.elasticsearch.script;
|
package org.elasticsearch.script;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.DateTimeZone;
|
import org.joda.time.DateTimeZone;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ import java.util.Locale;
|
||||||
*/
|
*/
|
||||||
public class JodaCompatibleZonedDateTime {
|
public class JodaCompatibleZonedDateTime {
|
||||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||||
new DeprecationLogger(ESLoggerFactory.getLogger(JodaCompatibleZonedDateTime.class));
|
new DeprecationLogger(LogManager.getLogger(JodaCompatibleZonedDateTime.class));
|
||||||
|
|
||||||
private static void logDeprecated(String key, String message, Object... params) {
|
private static void logDeprecated(String key, String message, Object... params) {
|
||||||
// NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts
|
// NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts
|
||||||
|
|
|
@ -22,13 +22,13 @@ package org.elasticsearch.bootstrap;
|
||||||
import com.carrotsearch.randomizedtesting.RandomizedRunner;
|
import com.carrotsearch.randomizedtesting.RandomizedRunner;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.elasticsearch.common.Booleans;
|
import org.elasticsearch.common.Booleans;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.io.FileSystemUtils;
|
import org.elasticsearch.common.io.FileSystemUtils;
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.network.IfConfig;
|
import org.elasticsearch.common.network.IfConfig;
|
||||||
import org.elasticsearch.plugins.PluginInfo;
|
import org.elasticsearch.plugins.PluginInfo;
|
||||||
import org.elasticsearch.secure_sm.SecureSM;
|
import org.elasticsearch.secure_sm.SecureSM;
|
||||||
|
@ -90,7 +90,7 @@ public class BootstrapForTesting {
|
||||||
|
|
||||||
// check for jar hell
|
// check for jar hell
|
||||||
try {
|
try {
|
||||||
final Logger logger = ESLoggerFactory.getLogger(JarHell.class);
|
final Logger logger = LogManager.getLogger(JarHell.class);
|
||||||
JarHell.checkJarHell(logger::debug);
|
JarHell.checkJarHell(logger::debug);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("found jar hell in test classpath", e);
|
throw new RuntimeException("found jar hell in test classpath", e);
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
package org.elasticsearch.xpack.core;
|
package org.elasticsearch.xpack.core;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.lucene.util.SetOnce;
|
import org.apache.lucene.util.SetOnce;
|
||||||
import org.elasticsearch.SpecialPermission;
|
import org.elasticsearch.SpecialPermission;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
|
@ -28,7 +29,6 @@ import org.elasticsearch.common.inject.multibindings.Multibinder;
|
||||||
import org.elasticsearch.common.inject.util.Providers;
|
import org.elasticsearch.common.inject.util.Providers;
|
||||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.ClusterSettings;
|
import org.elasticsearch.common.settings.ClusterSettings;
|
||||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
|
@ -84,7 +84,7 @@ import java.util.stream.StreamSupport;
|
||||||
|
|
||||||
public class XPackPlugin extends XPackClientPlugin implements ScriptPlugin, ExtensiblePlugin, RepositoryPlugin, EnginePlugin {
|
public class XPackPlugin extends XPackClientPlugin implements ScriptPlugin, ExtensiblePlugin, RepositoryPlugin, EnginePlugin {
|
||||||
|
|
||||||
private static Logger logger = ESLoggerFactory.getLogger(XPackPlugin.class);
|
private static Logger logger = LogManager.getLogger(XPackPlugin.class);
|
||||||
private static DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
private static DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||||
|
|
||||||
public static final String XPACK_INSTALLED_NODE_ATTR = "xpack.installed";
|
public static final String XPACK_INSTALLED_NODE_ATTR = "xpack.installed";
|
||||||
|
|
|
@ -11,12 +11,12 @@ import com.sun.net.httpserver.HttpsConfigurator;
|
||||||
import com.sun.net.httpserver.HttpsParameters;
|
import com.sun.net.httpserver.HttpsParameters;
|
||||||
import com.sun.net.httpserver.HttpsServer;
|
import com.sun.net.httpserver.HttpsServer;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.logging.log4j.util.Supplier;
|
import org.apache.logging.log4j.util.Supplier;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.io.Streams;
|
import org.elasticsearch.common.io.Streams;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
||||||
import org.elasticsearch.mocksocket.MockHttpServer;
|
import org.elasticsearch.mocksocket.MockHttpServer;
|
||||||
|
@ -73,7 +73,7 @@ public class MockWebServer implements Closeable {
|
||||||
*/
|
*/
|
||||||
public MockWebServer(SSLContext sslContext, boolean needClientAuth) {
|
public MockWebServer(SSLContext sslContext, boolean needClientAuth) {
|
||||||
this.needClientAuth = needClientAuth;
|
this.needClientAuth = needClientAuth;
|
||||||
this.logger = ESLoggerFactory.getLogger(this.getClass());
|
this.logger = LogManager.getLogger(this.getClass());
|
||||||
this.sslContext = sslContext;
|
this.sslContext = sslContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ import joptsimple.OptionParser;
|
||||||
import joptsimple.OptionSet;
|
import joptsimple.OptionSet;
|
||||||
import joptsimple.OptionSpec;
|
import joptsimple.OptionSpec;
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.core.Appender;
|
import org.apache.logging.log4j.core.Appender;
|
||||||
import org.apache.logging.log4j.core.LogEvent;
|
import org.apache.logging.log4j.core.LogEvent;
|
||||||
import org.apache.logging.log4j.core.LoggerContext;
|
import org.apache.logging.log4j.core.LoggerContext;
|
||||||
|
@ -26,7 +26,6 @@ import org.elasticsearch.cli.Terminal.Verbosity;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.SecureString;
|
import org.elasticsearch.common.settings.SecureString;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -360,7 +359,7 @@ public class ESNativeRealmMigrateTool extends LoggingAwareMultiCommand {
|
||||||
* Creates a new Logger that is detached from the ROOT logger and only has an appender that will output log messages to the terminal
|
* Creates a new Logger that is detached from the ROOT logger and only has an appender that will output log messages to the terminal
|
||||||
*/
|
*/
|
||||||
static Logger getTerminalLogger(final Terminal terminal) {
|
static Logger getTerminalLogger(final Terminal terminal) {
|
||||||
final Logger logger = ESLoggerFactory.getLogger(ESNativeRealmMigrateTool.class);
|
final Logger logger = LogManager.getLogger(ESNativeRealmMigrateTool.class);
|
||||||
Loggers.setLevel(logger, Level.ALL);
|
Loggers.setLevel(logger, Level.ALL);
|
||||||
|
|
||||||
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
|
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
package org.elasticsearch.xpack.security.authc.kerberos;
|
package org.elasticsearch.xpack.security.authc.kerberos;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.common.collect.Tuple;
|
import org.elasticsearch.common.collect.Tuple;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.ietf.jgss.GSSContext;
|
import org.ietf.jgss.GSSContext;
|
||||||
import org.ietf.jgss.GSSCredential;
|
import org.ietf.jgss.GSSCredential;
|
||||||
import org.ietf.jgss.GSSException;
|
import org.ietf.jgss.GSSException;
|
||||||
|
@ -53,7 +53,7 @@ public class KerberosTicketValidator {
|
||||||
return oid;
|
return oid;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger LOGGER = ESLoggerFactory.getLogger(KerberosTicketValidator.class);
|
private static final Logger LOGGER = LogManager.getLogger(KerberosTicketValidator.class);
|
||||||
|
|
||||||
private static final String KEY_TAB_CONF_NAME = "KeytabConf";
|
private static final String KEY_TAB_CONF_NAME = "KeytabConf";
|
||||||
private static final String SUN_KRB5_LOGIN_MODULE = "com.sun.security.auth.module.Krb5LoginModule";
|
private static final String SUN_KRB5_LOGIN_MODULE = "com.sun.security.auth.module.Krb5LoginModule";
|
||||||
|
|
|
@ -23,6 +23,7 @@ import com.unboundid.ldap.sdk.SearchResultEntry;
|
||||||
import com.unboundid.ldap.sdk.SearchResultReference;
|
import com.unboundid.ldap.sdk.SearchResultReference;
|
||||||
import com.unboundid.ldap.sdk.SearchScope;
|
import com.unboundid.ldap.sdk.SearchScope;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.logging.log4j.util.Supplier;
|
import org.apache.logging.log4j.util.Supplier;
|
||||||
import org.elasticsearch.core.internal.io.IOUtils;
|
import org.elasticsearch.core.internal.io.IOUtils;
|
||||||
|
@ -32,7 +33,6 @@ import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.common.CheckedSupplier;
|
import org.elasticsearch.common.CheckedSupplier;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
||||||
import org.elasticsearch.common.util.concurrent.CountDown;
|
import org.elasticsearch.common.util.concurrent.CountDown;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
|
@ -55,7 +55,7 @@ public final class LdapUtils {
|
||||||
|
|
||||||
public static final Filter OBJECT_CLASS_PRESENCE_FILTER = Filter.createPresenceFilter("objectClass");
|
public static final Filter OBJECT_CLASS_PRESENCE_FILTER = Filter.createPresenceFilter("objectClass");
|
||||||
|
|
||||||
private static final Logger LOGGER = ESLoggerFactory.getLogger(LdapUtils.class);
|
private static final Logger LOGGER = LogManager.getLogger(LdapUtils.class);
|
||||||
|
|
||||||
private LdapUtils() {
|
private LdapUtils() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,12 +37,12 @@ import java.util.Objects;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.core.internal.io.IOUtils;
|
import org.elasticsearch.core.internal.io.IOUtils;
|
||||||
import org.elasticsearch.ElasticsearchSecurityException;
|
import org.elasticsearch.ElasticsearchSecurityException;
|
||||||
import org.elasticsearch.SpecialPermission;
|
import org.elasticsearch.SpecialPermission;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.hash.MessageDigests;
|
import org.elasticsearch.common.hash.MessageDigests;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.xpack.security.support.RestorableContextClassLoader;
|
import org.elasticsearch.xpack.security.support.RestorableContextClassLoader;
|
||||||
import org.opensaml.core.config.InitializationService;
|
import org.opensaml.core.config.InitializationService;
|
||||||
import org.opensaml.core.xml.XMLObject;
|
import org.opensaml.core.xml.XMLObject;
|
||||||
|
@ -71,7 +71,7 @@ public class SamlUtils {
|
||||||
private static final SecureRandom SECURE_RANDOM = new SecureRandom();
|
private static final SecureRandom SECURE_RANDOM = new SecureRandom();
|
||||||
|
|
||||||
private static XMLObjectBuilderFactory builderFactory = null;
|
private static XMLObjectBuilderFactory builderFactory = null;
|
||||||
private static final Logger LOGGER = ESLoggerFactory.getLogger(SamlUtils.class);
|
private static final Logger LOGGER = LogManager.getLogger(SamlUtils.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is needed in order to initialize the underlying OpenSAML library.
|
* This is needed in order to initialize the underlying OpenSAML library.
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
package org.elasticsearch.xpack.security.rest;
|
package org.elasticsearch.xpack.security.rest;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.logging.log4j.util.Supplier;
|
import org.apache.logging.log4j.util.Supplier;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.client.node.NodeClient;
|
import org.elasticsearch.client.node.NodeClient;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.http.HttpChannel;
|
import org.elasticsearch.http.HttpChannel;
|
||||||
import org.elasticsearch.license.XPackLicenseState;
|
import org.elasticsearch.license.XPackLicenseState;
|
||||||
|
@ -27,7 +27,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
public class SecurityRestFilter implements RestHandler {
|
public class SecurityRestFilter implements RestHandler {
|
||||||
|
|
||||||
private static final Logger logger = ESLoggerFactory.getLogger(SecurityRestFilter.class);
|
private static final Logger logger = LogManager.getLogger(SecurityRestFilter.class);
|
||||||
|
|
||||||
private final RestHandler restHandler;
|
private final RestHandler restHandler;
|
||||||
private final AuthenticationService service;
|
private final AuthenticationService service;
|
||||||
|
|
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.watcher.notification.jira;
|
||||||
import org.elasticsearch.common.Booleans;
|
import org.elasticsearch.common.Booleans;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.SecureSetting;
|
import org.elasticsearch.common.settings.SecureSetting;
|
||||||
import org.elasticsearch.common.settings.SecureString;
|
import org.elasticsearch.common.settings.SecureString;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
|
@ -64,7 +63,6 @@ public class JiraAccount {
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
String url = getSetting(name, URL_SETTING, settings, SECURE_URL_SETTING);
|
String url = getSetting(name, URL_SETTING, settings, SECURE_URL_SETTING);
|
||||||
ESLoggerFactory.getLogger(getClass()).error("THE URL WAS [{}]", url);
|
|
||||||
try {
|
try {
|
||||||
URI uri = new URI(url);
|
URI uri = new URI(url);
|
||||||
Scheme protocol = Scheme.parse(uri.getScheme());
|
Scheme protocol = Scheme.parse(uri.getScheme());
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
package org.elasticsearch.xpack.security.authc.kerberos;
|
package org.elasticsearch.xpack.security.authc.kerberos;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
|
||||||
import org.elasticsearch.common.settings.SecureString;
|
import org.elasticsearch.common.settings.SecureString;
|
||||||
import org.elasticsearch.xpack.security.authc.kerberos.KerberosTicketValidator;
|
import org.elasticsearch.xpack.security.authc.kerberos.KerberosTicketValidator;
|
||||||
import org.ietf.jgss.GSSContext;
|
import org.ietf.jgss.GSSContext;
|
||||||
|
@ -50,7 +50,7 @@ import javax.security.auth.login.LoginException;
|
||||||
* {@link GSSContext} after usage.
|
* {@link GSSContext} after usage.
|
||||||
*/
|
*/
|
||||||
class SpnegoClient implements AutoCloseable {
|
class SpnegoClient implements AutoCloseable {
|
||||||
private static final Logger LOGGER = ESLoggerFactory.getLogger(SpnegoClient.class);
|
private static final Logger LOGGER = LogManager.getLogger(SpnegoClient.class);
|
||||||
|
|
||||||
public static final String CRED_CONF_NAME = "PasswordConf";
|
public static final String CRED_CONF_NAME = "PasswordConf";
|
||||||
private static final String SUN_KRB5_LOGIN_MODULE = "com.sun.security.auth.module.Krb5LoginModule";
|
private static final String SUN_KRB5_LOGIN_MODULE = "com.sun.security.auth.module.Krb5LoginModule";
|
||||||
|
|
Loading…
Reference in New Issue