Handle removing log4j dependency from elasticsearch-core jar (elastic/x-pack-elasticsearch#3976)
This handles the removal of the log4j dependency from our elasticsearch-core project. It was originally necessary only for our jar classpath checking. It is now replaced by a `Consumer<String>`. This is the x-pack side of https://github.com/elastic/elasticsearch/pull/28705 Original commit: elastic/x-pack-elasticsearch@1186a7eaf6
This commit is contained in:
parent
e365a255c7
commit
6728912c87
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext.StoredContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext.StoredContext;
|
||||||
|
@ -35,7 +35,7 @@ public class SecurityContext {
|
||||||
* and {@link UserSettings#getAuthentication()} will always return null.
|
* and {@link UserSettings#getAuthentication()} will always return null.
|
||||||
*/
|
*/
|
||||||
public SecurityContext(Settings settings, ThreadContext threadContext) {
|
public SecurityContext(Settings settings, ThreadContext threadContext) {
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), settings);
|
this.logger = Loggers.getLogger(getClass(), settings);
|
||||||
this.threadContext = threadContext;
|
this.threadContext = threadContext;
|
||||||
this.userSettings = new UserSettings(settings, threadContext);
|
this.userSettings = new UserSettings(settings, threadContext);
|
||||||
this.nodeName = Node.NODE_NAME_SETTING.get(settings);
|
this.nodeName = Node.NODE_NAME_SETTING.get(settings);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.core.security;
|
package org.elasticsearch.xpack.core.security;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.xpack.core.security.authc.Authentication;
|
import org.elasticsearch.xpack.core.security.authc.Authentication;
|
||||||
|
@ -19,7 +19,7 @@ public final class UserSettings {
|
||||||
private final ThreadContext threadContext;
|
private final ThreadContext threadContext;
|
||||||
|
|
||||||
UserSettings(Settings settings, ThreadContext threadContext) {
|
UserSettings(Settings settings, ThreadContext threadContext) {
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), settings);
|
this.logger = Loggers.getLogger(getClass(), settings);
|
||||||
this.threadContext = threadContext;
|
this.threadContext = threadContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.core.security.authc;
|
package org.elasticsearch.xpack.core.security.authc;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
|
@ -60,7 +60,7 @@ public class RealmConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logger logger(Class clazz) {
|
public Logger logger(Class clazz) {
|
||||||
return ServerLoggers.getLogger(clazz, globalSettings);
|
return Loggers.getLogger(clazz, globalSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Environment env() {
|
public Environment env() {
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.logging.LoggerMessageFormat;
|
import org.elasticsearch.common.logging.LoggerMessageFormat;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.lucene.search.Queries;
|
import org.elasticsearch.common.lucene.search.Queries;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||||
|
@ -99,7 +99,7 @@ public class SecurityIndexSearcherWrapper extends IndexSearcherWrapper {
|
||||||
BitsetFilterCache bitsetFilterCache, ThreadContext threadContext, XPackLicenseState licenseState,
|
BitsetFilterCache bitsetFilterCache, ThreadContext threadContext, XPackLicenseState licenseState,
|
||||||
ScriptService scriptService) {
|
ScriptService scriptService) {
|
||||||
this.scriptService = scriptService;
|
this.scriptService = scriptService;
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), indexSettings.getSettings());
|
this.logger = Loggers.getLogger(getClass(), indexSettings.getSettings());
|
||||||
this.queryShardContextProvider = queryShardContextProvider;
|
this.queryShardContextProvider = queryShardContextProvider;
|
||||||
this.bitsetFilterCache = bitsetFilterCache;
|
this.bitsetFilterCache = bitsetFilterCache;
|
||||||
this.threadContext = threadContext;
|
this.threadContext = threadContext;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.bouncycastle.asn1.ASN1Sequence;
|
||||||
import org.bouncycastle.asn1.ASN1String;
|
import org.bouncycastle.asn1.ASN1String;
|
||||||
import org.bouncycastle.asn1.ASN1TaggedObject;
|
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||||||
import org.bouncycastle.asn1.DERTaggedObject;
|
import org.bouncycastle.asn1.DERTaggedObject;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
|
||||||
import javax.net.ssl.SSLEngine;
|
import javax.net.ssl.SSLEngine;
|
||||||
|
@ -47,7 +47,7 @@ public final class RestrictedTrustManager extends X509ExtendedTrustManager {
|
||||||
private final int SAN_CODE_OTHERNAME = 0;
|
private final int SAN_CODE_OTHERNAME = 0;
|
||||||
|
|
||||||
public RestrictedTrustManager(Settings settings, X509ExtendedTrustManager delegate, CertificateTrustRestrictions restrictions) {
|
public RestrictedTrustManager(Settings settings, X509ExtendedTrustManager delegate, CertificateTrustRestrictions restrictions) {
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), settings);
|
this.logger = Loggers.getLogger(getClass(), settings);
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
this.trustRestrictions = restrictions;
|
this.trustRestrictions = restrictions;
|
||||||
logger.debug("Configured with trust restrictions: [{}]", restrictions);
|
logger.debug("Configured with trust restrictions: [{}]", restrictions);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.core.watcher.transform.chain;
|
package org.elasticsearch.xpack.core.watcher.transform.chain;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.transform.ExecutableTransform;
|
import org.elasticsearch.xpack.core.watcher.transform.ExecutableTransform;
|
||||||
|
@ -21,7 +21,7 @@ public final class ChainTransformFactory extends TransformFactory<ChainTransform
|
||||||
private final TransformRegistry registry;
|
private final TransformRegistry registry;
|
||||||
|
|
||||||
public ChainTransformFactory(Settings settings, TransformRegistry registry) {
|
public ChainTransformFactory(Settings settings, TransformRegistry registry) {
|
||||||
super(ServerLoggers.getLogger(ExecutableChainTransform.class, settings));
|
super(Loggers.getLogger(ExecutableChainTransform.class, settings));
|
||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.apache.logging.log4j.core.config.Configuration;
|
||||||
import org.apache.logging.log4j.core.config.LoggerConfig;
|
import org.apache.logging.log4j.core.config.LoggerConfig;
|
||||||
import org.apache.logging.log4j.core.filter.RegexFilter;
|
import org.apache.logging.log4j.core.filter.RegexFilter;
|
||||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -26,10 +26,10 @@ public class CapturingLogger {
|
||||||
final StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
|
final StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
|
||||||
final String name = caller.getClassName() + "." + caller.getMethodName() + "." + level.toString();
|
final String name = caller.getClassName() + "." + caller.getMethodName() + "." + level.toString();
|
||||||
final Logger logger = ESLoggerFactory.getLogger(name);
|
final Logger logger = ESLoggerFactory.getLogger(name);
|
||||||
ServerLoggers.setLevel(logger, level);
|
Loggers.setLevel(logger, level);
|
||||||
final MockAppender appender = new MockAppender(name);
|
final MockAppender appender = new MockAppender(name);
|
||||||
appender.start();
|
appender.start();
|
||||||
ServerLoggers.addAppender(logger, appender);
|
Loggers.addAppender(logger, appender);
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.job.process.logging;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.MockLogAppender;
|
import org.elasticsearch.test.MockLogAppender;
|
||||||
|
@ -207,15 +206,15 @@ public class CppLogMessageHandlerTests extends ESTestCase {
|
||||||
private static void executeLoggingTest(InputStream is, MockLogAppender mockAppender, Level level, String jobId)
|
private static void executeLoggingTest(InputStream is, MockLogAppender mockAppender, Level level, String jobId)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Logger cppMessageLogger = Loggers.getLogger(CppLogMessageHandler.class);
|
Logger cppMessageLogger = Loggers.getLogger(CppLogMessageHandler.class);
|
||||||
ServerLoggers.addAppender(cppMessageLogger, mockAppender);
|
Loggers.addAppender(cppMessageLogger, mockAppender);
|
||||||
|
|
||||||
Level oldLevel = cppMessageLogger.getLevel();
|
Level oldLevel = cppMessageLogger.getLevel();
|
||||||
ServerLoggers.setLevel(cppMessageLogger, level);
|
Loggers.setLevel(cppMessageLogger, level);
|
||||||
try (CppLogMessageHandler handler = new CppLogMessageHandler(jobId, is)) {
|
try (CppLogMessageHandler handler = new CppLogMessageHandler(jobId, is)) {
|
||||||
handler.tailStream();
|
handler.tailStream();
|
||||||
} finally {
|
} finally {
|
||||||
ServerLoggers.removeAppender(cppMessageLogger, mockAppender);
|
Loggers.removeAppender(cppMessageLogger, mockAppender);
|
||||||
ServerLoggers.setLevel(cppMessageLogger, oldLevel);
|
Loggers.setLevel(cppMessageLogger, oldLevel);
|
||||||
mockAppender.stop();
|
mockAppender.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,6 @@ import org.elasticsearch.xpack.core.security.authc.DefaultAuthenticationFailureH
|
||||||
import org.elasticsearch.xpack.core.security.authc.Realm;
|
import org.elasticsearch.xpack.core.security.authc.Realm;
|
||||||
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
|
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
|
||||||
import org.elasticsearch.xpack.core.security.authc.TokenMetaData;
|
import org.elasticsearch.xpack.core.security.authc.TokenMetaData;
|
||||||
import org.elasticsearch.xpack.core.security.authc.esnative.NativeRealmSettings;
|
|
||||||
import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.xpack.core.security.authz.AuthorizationServiceField;
|
import org.elasticsearch.xpack.core.security.authz.AuthorizationServiceField;
|
||||||
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor;
|
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.bulk.BulkItemResponse;
|
import org.elasticsearch.action.bulk.BulkItemResponse;
|
||||||
import org.elasticsearch.action.search.SearchRequest;
|
import org.elasticsearch.action.search.SearchRequest;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
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.util.concurrent.AbstractRunnable;
|
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
||||||
|
@ -44,7 +44,7 @@ final class ExpiredTokenRemover extends AbstractRunnable {
|
||||||
|
|
||||||
ExpiredTokenRemover(Settings settings, Client client) {
|
ExpiredTokenRemover(Settings settings, Client client) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), settings);
|
this.logger = Loggers.getLogger(getClass(), settings);
|
||||||
this.timeout = TokenService.DELETE_TIMEOUT.get(settings);
|
this.timeout = TokenService.DELETE_TIMEOUT.get(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ 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.ESLoggerFactory;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
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;
|
||||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||||
|
@ -360,7 +360,7 @@ public class ESNativeRealmMigrateTool extends LoggingAwareMultiCommand {
|
||||||
*/
|
*/
|
||||||
static Logger getTerminalLogger(final Terminal terminal) {
|
static Logger getTerminalLogger(final Terminal terminal) {
|
||||||
final Logger logger = ESLoggerFactory.getLogger(ESNativeRealmMigrateTool.class);
|
final Logger logger = ESLoggerFactory.getLogger(ESNativeRealmMigrateTool.class);
|
||||||
ServerLoggers.setLevel(logger, Level.ALL);
|
Loggers.setLevel(logger, Level.ALL);
|
||||||
|
|
||||||
// create appender
|
// create appender
|
||||||
final Appender appender = new AbstractAppender(ESNativeRealmMigrateTool.class.getName(), null,
|
final Appender appender = new AbstractAppender(ESNativeRealmMigrateTool.class.getName(), null,
|
||||||
|
@ -387,8 +387,8 @@ public class ESNativeRealmMigrateTool extends LoggingAwareMultiCommand {
|
||||||
final Configuration config = ctx.getConfiguration();
|
final Configuration config = ctx.getConfiguration();
|
||||||
final LoggerConfig loggerConfig = config.getLoggerConfig(ESNativeRealmMigrateTool.class.getName());
|
final LoggerConfig loggerConfig = config.getLoggerConfig(ESNativeRealmMigrateTool.class.getName());
|
||||||
loggerConfig.setParent(null);
|
loggerConfig.setParent(null);
|
||||||
loggerConfig.getAppenders().forEach((s, a) -> ServerLoggers.removeAppender(logger, a));
|
loggerConfig.getAppenders().forEach((s, a) -> Loggers.removeAppender(logger, a));
|
||||||
ServerLoggers.addAppender(logger, appender);
|
Loggers.addAppender(logger, appender);
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.elasticsearch.cli.UserException;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.LocaleUtils;
|
import org.elasticsearch.common.util.LocaleUtils;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
|
@ -90,7 +89,7 @@ public class SamlMetadataCommand extends EnvironmentAwareCommand {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception {
|
protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception {
|
||||||
// OpenSAML prints a lot of _stuff_ at info level, that really isn't needed in a command line tool.
|
// OpenSAML prints a lot of _stuff_ at info level, that really isn't needed in a command line tool.
|
||||||
ServerLoggers.setLevel(Loggers.getLogger("org.opensaml"), Level.WARN);
|
Loggers.setLevel(Loggers.getLogger("org.opensaml"), Level.WARN);
|
||||||
|
|
||||||
final Logger logger = Loggers.getLogger(getClass());
|
final Logger logger = Loggers.getLogger(getClass());
|
||||||
SamlUtils.initialize(logger);
|
SamlUtils.initialize(logger);
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.ElasticsearchSecurityException;
|
||||||
import org.elasticsearch.common.CheckedFunction;
|
import org.elasticsearch.common.CheckedFunction;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
|
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
|
||||||
import org.elasticsearch.xpack.security.support.RestorableContextClassLoader;
|
import org.elasticsearch.xpack.security.support.RestorableContextClassLoader;
|
||||||
|
@ -84,7 +84,7 @@ public class SamlRequestHandler {
|
||||||
private final UnmarshallerFactory unmarshallerFactory;
|
private final UnmarshallerFactory unmarshallerFactory;
|
||||||
|
|
||||||
public SamlRequestHandler(RealmConfig realmConfig, Clock clock, IdpConfiguration idp, SpConfiguration sp, TimeValue maxSkew) {
|
public SamlRequestHandler(RealmConfig realmConfig, Clock clock, IdpConfiguration idp, SpConfiguration sp, TimeValue maxSkew) {
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), realmConfig.globalSettings());
|
this.logger = Loggers.getLogger(getClass(), realmConfig.globalSettings());
|
||||||
this.clock = clock;
|
this.clock = clock;
|
||||||
this.idp = idp;
|
this.idp = idp;
|
||||||
this.sp = sp;
|
this.sp = sp;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import io.netty.handler.ipfilter.IpFilterRuleType;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.lucene.util.SetOnce;
|
import org.apache.lucene.util.SetOnce;
|
||||||
import org.elasticsearch.common.collect.MapBuilder;
|
import org.elasticsearch.common.collect.MapBuilder;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.ClusterSettings;
|
import org.elasticsearch.common.settings.ClusterSettings;
|
||||||
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;
|
||||||
|
@ -117,7 +117,7 @@ public class IPFilter {
|
||||||
|
|
||||||
public IPFilter(final Settings settings, AuditTrailService auditTrail, ClusterSettings clusterSettings,
|
public IPFilter(final Settings settings, AuditTrailService auditTrail, ClusterSettings clusterSettings,
|
||||||
XPackLicenseState licenseState) {
|
XPackLicenseState licenseState) {
|
||||||
this.logger = ServerLoggers.getLogger(getClass(), settings);
|
this.logger = Loggers.getLogger(getClass(), settings);
|
||||||
this.auditTrail = auditTrail;
|
this.auditTrail = auditTrail;
|
||||||
this.licenseState = licenseState;
|
this.licenseState = licenseState;
|
||||||
this.alwaysAllowBoundAddresses = ALLOW_BOUND_ADDRESSES_SETTING.get(settings);
|
this.alwaysAllowBoundAddresses = ALLOW_BOUND_ADDRESSES_SETTING.get(settings);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.email;
|
package org.elasticsearch.xpack.watcher.actions.email;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -25,7 +25,7 @@ public class EmailActionFactory extends ActionFactory {
|
||||||
|
|
||||||
public EmailActionFactory(Settings settings, EmailService emailService, TextTemplateEngine templateEngine,
|
public EmailActionFactory(Settings settings, EmailService emailService, TextTemplateEngine templateEngine,
|
||||||
EmailAttachmentsParser emailAttachmentsParser) {
|
EmailAttachmentsParser emailAttachmentsParser) {
|
||||||
super(ServerLoggers.getLogger(ExecutableEmailAction.class, settings));
|
super(Loggers.getLogger(ExecutableEmailAction.class, settings));
|
||||||
this.emailService = emailService;
|
this.emailService = emailService;
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
this.htmlSanitizer = new HtmlSanitizer(settings);
|
this.htmlSanitizer = new HtmlSanitizer(settings);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.hipchat;
|
package org.elasticsearch.xpack.watcher.actions.hipchat;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -21,7 +21,7 @@ public class HipChatActionFactory extends ActionFactory {
|
||||||
private final HipChatService hipchatService;
|
private final HipChatService hipchatService;
|
||||||
|
|
||||||
public HipChatActionFactory(Settings settings, TextTemplateEngine templateEngine, HipChatService hipchatService) {
|
public HipChatActionFactory(Settings settings, TextTemplateEngine templateEngine, HipChatService hipchatService) {
|
||||||
super(ServerLoggers.getLogger(ExecutableHipChatAction.class, settings));
|
super(Loggers.getLogger(ExecutableHipChatAction.class, settings));
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
this.hipchatService = hipchatService;
|
this.hipchatService = hipchatService;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.actions.index;
|
package org.elasticsearch.xpack.watcher.actions.index;
|
||||||
|
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
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.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -21,7 +21,7 @@ public class IndexActionFactory extends ActionFactory {
|
||||||
private final TimeValue bulkDefaultTimeout;
|
private final TimeValue bulkDefaultTimeout;
|
||||||
|
|
||||||
public IndexActionFactory(Settings settings, Client client) {
|
public IndexActionFactory(Settings settings, Client client) {
|
||||||
super(ServerLoggers.getLogger(IndexActionFactory.class, settings));
|
super(Loggers.getLogger(IndexActionFactory.class, settings));
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.indexDefaultTimeout = settings.getAsTime("xpack.watcher.actions.index.default_timeout", TimeValue.timeValueSeconds(30));
|
this.indexDefaultTimeout = settings.getAsTime("xpack.watcher.actions.index.default_timeout", TimeValue.timeValueSeconds(30));
|
||||||
this.bulkDefaultTimeout = settings.getAsTime("xpack.watcher.actions.bulk.default_timeout", TimeValue.timeValueMinutes(1));
|
this.bulkDefaultTimeout = settings.getAsTime("xpack.watcher.actions.bulk.default_timeout", TimeValue.timeValueMinutes(1));
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.jira;
|
package org.elasticsearch.xpack.watcher.actions.jira;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -20,7 +20,7 @@ public class JiraActionFactory extends ActionFactory {
|
||||||
private final JiraService jiraService;
|
private final JiraService jiraService;
|
||||||
|
|
||||||
public JiraActionFactory(Settings settings, TextTemplateEngine templateEngine, JiraService jiraService) {
|
public JiraActionFactory(Settings settings, TextTemplateEngine templateEngine, JiraService jiraService) {
|
||||||
super(ServerLoggers.getLogger(ExecutableJiraAction.class, settings));
|
super(Loggers.getLogger(ExecutableJiraAction.class, settings));
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
this.jiraService = jiraService;
|
this.jiraService = jiraService;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.actions.logging;
|
package org.elasticsearch.xpack.watcher.actions.logging;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.Action;
|
import org.elasticsearch.xpack.core.watcher.actions.Action;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ExecutableAction;
|
import org.elasticsearch.xpack.core.watcher.actions.ExecutableAction;
|
||||||
|
@ -24,7 +24,7 @@ public class ExecutableLoggingAction extends ExecutableAction<LoggingAction> {
|
||||||
|
|
||||||
public ExecutableLoggingAction(LoggingAction action, Logger logger, Settings settings, TextTemplateEngine templateEngine) {
|
public ExecutableLoggingAction(LoggingAction action, Logger logger, Settings settings, TextTemplateEngine templateEngine) {
|
||||||
super(action, logger);
|
super(action, logger);
|
||||||
this.textLogger = action.category != null ? ServerLoggers.getLogger(action.category, settings) : logger;
|
this.textLogger = action.category != null ? Loggers.getLogger(action.category, settings) : logger;
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.logging;
|
package org.elasticsearch.xpack.watcher.actions.logging;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -19,7 +19,7 @@ public class LoggingActionFactory extends ActionFactory {
|
||||||
private final TextTemplateEngine templateEngine;
|
private final TextTemplateEngine templateEngine;
|
||||||
|
|
||||||
public LoggingActionFactory(Settings settings, TextTemplateEngine templateEngine) {
|
public LoggingActionFactory(Settings settings, TextTemplateEngine templateEngine) {
|
||||||
super(ServerLoggers.getLogger(ExecutableLoggingAction.class, settings));
|
super(Loggers.getLogger(ExecutableLoggingAction.class, settings));
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.pagerduty;
|
package org.elasticsearch.xpack.watcher.actions.pagerduty;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -20,7 +20,7 @@ public class PagerDutyActionFactory extends ActionFactory {
|
||||||
private final PagerDutyService pagerDutyService;
|
private final PagerDutyService pagerDutyService;
|
||||||
|
|
||||||
public PagerDutyActionFactory(Settings settings, TextTemplateEngine templateEngine, PagerDutyService pagerDutyService) {
|
public PagerDutyActionFactory(Settings settings, TextTemplateEngine templateEngine, PagerDutyService pagerDutyService) {
|
||||||
super(ServerLoggers.getLogger(ExecutablePagerDutyAction.class, settings));
|
super(Loggers.getLogger(ExecutablePagerDutyAction.class, settings));
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
this.pagerDutyService = pagerDutyService;
|
this.pagerDutyService = pagerDutyService;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.slack;
|
package org.elasticsearch.xpack.watcher.actions.slack;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -19,7 +19,7 @@ public class SlackActionFactory extends ActionFactory {
|
||||||
private final SlackService slackService;
|
private final SlackService slackService;
|
||||||
|
|
||||||
public SlackActionFactory(Settings settings, TextTemplateEngine templateEngine, SlackService slackService) {
|
public SlackActionFactory(Settings settings, TextTemplateEngine templateEngine, SlackService slackService) {
|
||||||
super(ServerLoggers.getLogger(ExecutableSlackAction.class, settings));
|
super(Loggers.getLogger(ExecutableSlackAction.class, settings));
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
this.slackService = slackService;
|
this.slackService = slackService;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.actions.webhook;
|
package org.elasticsearch.xpack.watcher.actions.webhook;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
import org.elasticsearch.xpack.core.watcher.actions.ActionFactory;
|
||||||
|
@ -24,7 +24,7 @@ public class WebhookActionFactory extends ActionFactory {
|
||||||
public WebhookActionFactory(Settings settings, HttpClient httpClient, HttpRequestTemplate.Parser requestTemplateParser,
|
public WebhookActionFactory(Settings settings, HttpClient httpClient, HttpRequestTemplate.Parser requestTemplateParser,
|
||||||
TextTemplateEngine templateEngine) {
|
TextTemplateEngine templateEngine) {
|
||||||
|
|
||||||
super(ServerLoggers.getLogger(ExecutableWebhookAction.class, settings));
|
super(Loggers.getLogger(ExecutableWebhookAction.class, settings));
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
this.requestTemplateParser = requestTemplateParser;
|
this.requestTemplateParser = requestTemplateParser;
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.watcher.execution;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
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.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent;
|
import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class AsyncTriggerEventConsumer implements Consumer<Iterable<TriggerEvent
|
||||||
private final ExecutionService executionService;
|
private final ExecutionService executionService;
|
||||||
|
|
||||||
public AsyncTriggerEventConsumer(Settings settings, ExecutionService executionService) {
|
public AsyncTriggerEventConsumer(Settings settings, ExecutionService executionService) {
|
||||||
this.logger = ServerLoggers.getLogger(SyncTriggerEventConsumer.class, settings);
|
this.logger = Loggers.getLogger(SyncTriggerEventConsumer.class, settings);
|
||||||
this.executionService = executionService;
|
this.executionService = executionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.watcher.execution;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
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.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent;
|
import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class SyncTriggerEventConsumer implements Consumer<Iterable<TriggerEvent>
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
|
|
||||||
public SyncTriggerEventConsumer(Settings settings, ExecutionService executionService) {
|
public SyncTriggerEventConsumer(Settings settings, ExecutionService executionService) {
|
||||||
this.logger = ServerLoggers.getLogger(SyncTriggerEventConsumer.class, settings);
|
this.logger = Loggers.getLogger(SyncTriggerEventConsumer.class, settings);
|
||||||
this.executionService = executionService;
|
this.executionService = executionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.input.chain;
|
package org.elasticsearch.xpack.watcher.input.chain;
|
||||||
|
|
||||||
import org.elasticsearch.common.collect.Tuple;
|
import org.elasticsearch.common.collect.Tuple;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.input.ExecutableInput;
|
import org.elasticsearch.xpack.core.watcher.input.ExecutableInput;
|
||||||
|
@ -23,7 +23,7 @@ public class ChainInputFactory extends InputFactory<ChainInput, ChainInput.Resul
|
||||||
private final InputRegistry inputRegistry;
|
private final InputRegistry inputRegistry;
|
||||||
|
|
||||||
public ChainInputFactory(Settings settings, InputRegistry inputRegistry) {
|
public ChainInputFactory(Settings settings, InputRegistry inputRegistry) {
|
||||||
super(ServerLoggers.getLogger(ExecutableChainInput.class, settings));
|
super(Loggers.getLogger(ExecutableChainInput.class, settings));
|
||||||
this.inputRegistry = inputRegistry;
|
this.inputRegistry = inputRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.input.http;
|
package org.elasticsearch.xpack.watcher.input.http;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.watcher.common.http.HttpClient;
|
import org.elasticsearch.xpack.watcher.common.http.HttpClient;
|
||||||
|
@ -23,7 +23,7 @@ public final class HttpInputFactory extends InputFactory<HttpInput, HttpInput.Re
|
||||||
|
|
||||||
public HttpInputFactory(Settings settings, HttpClient httpClient, TextTemplateEngine templateEngine,
|
public HttpInputFactory(Settings settings, HttpClient httpClient, TextTemplateEngine templateEngine,
|
||||||
HttpRequestTemplate.Parser requestTemplateParser) {
|
HttpRequestTemplate.Parser requestTemplateParser) {
|
||||||
super(ServerLoggers.getLogger(ExecutableHttpInput.class, settings));
|
super(Loggers.getLogger(ExecutableHttpInput.class, settings));
|
||||||
this.templateEngine = templateEngine;
|
this.templateEngine = templateEngine;
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
this.requestTemplateParser = requestTemplateParser;
|
this.requestTemplateParser = requestTemplateParser;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.input.none;
|
package org.elasticsearch.xpack.watcher.input.none;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.core.watcher.input.none.NoneInput;
|
import org.elasticsearch.xpack.core.watcher.input.none.NoneInput;
|
||||||
|
@ -16,7 +16,7 @@ import java.io.IOException;
|
||||||
public class NoneInputFactory extends InputFactory<NoneInput, NoneInput.Result, ExecutableNoneInput> {
|
public class NoneInputFactory extends InputFactory<NoneInput, NoneInput.Result, ExecutableNoneInput> {
|
||||||
|
|
||||||
public NoneInputFactory(Settings settings) {
|
public NoneInputFactory(Settings settings) {
|
||||||
super(ServerLoggers.getLogger(ExecutableNoneInput.class, settings));
|
super(Loggers.getLogger(ExecutableNoneInput.class, settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.input.search;
|
package org.elasticsearch.xpack.watcher.input.search;
|
||||||
|
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
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.NamedXContentRegistry;
|
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||||
|
@ -25,7 +25,7 @@ public class SearchInputFactory extends InputFactory<SearchInput, SearchInput.Re
|
||||||
|
|
||||||
public SearchInputFactory(Settings settings, Client client, NamedXContentRegistry xContentRegistry,
|
public SearchInputFactory(Settings settings, Client client, NamedXContentRegistry xContentRegistry,
|
||||||
ScriptService scriptService) {
|
ScriptService scriptService) {
|
||||||
super(ServerLoggers.getLogger(ExecutableSearchInput.class, settings));
|
super(Loggers.getLogger(ExecutableSearchInput.class, settings));
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.defaultTimeout = settings.getAsTime("xpack.watcher.input.search.default_timeout", TimeValue.timeValueMinutes(1));
|
this.defaultTimeout = settings.getAsTime("xpack.watcher.input.search.default_timeout", TimeValue.timeValueMinutes(1));
|
||||||
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, xContentRegistry);
|
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, xContentRegistry);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.input.simple;
|
package org.elasticsearch.xpack.watcher.input.simple;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.xpack.watcher.input.InputFactory;
|
import org.elasticsearch.xpack.watcher.input.InputFactory;
|
||||||
|
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||||
public class SimpleInputFactory extends InputFactory<SimpleInput, SimpleInput.Result, ExecutableSimpleInput> {
|
public class SimpleInputFactory extends InputFactory<SimpleInput, SimpleInput.Result, ExecutableSimpleInput> {
|
||||||
|
|
||||||
public SimpleInputFactory(Settings settings) {
|
public SimpleInputFactory(Settings settings) {
|
||||||
super(ServerLoggers.getLogger(ExecutableSimpleInput.class, settings));
|
super(Loggers.getLogger(ExecutableSimpleInput.class, settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.input.transform;
|
package org.elasticsearch.xpack.watcher.input.transform;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.common.xcontent.XContentParserUtils;
|
import org.elasticsearch.common.xcontent.XContentParserUtils;
|
||||||
|
@ -32,7 +32,7 @@ public final class TransformInputFactory extends InputFactory<TransformInput, Tr
|
||||||
private final TransformRegistry transformRegistry;
|
private final TransformRegistry transformRegistry;
|
||||||
|
|
||||||
public TransformInputFactory(Settings settings, TransformRegistry transformRegistry) {
|
public TransformInputFactory(Settings settings, TransformRegistry transformRegistry) {
|
||||||
super(ServerLoggers.getLogger(ExecutableTransformInput.class, settings));
|
super(Loggers.getLogger(ExecutableTransformInput.class, settings));
|
||||||
this.transformRegistry = transformRegistry;
|
this.transformRegistry = transformRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.transform.script;
|
package org.elasticsearch.xpack.watcher.transform.script;
|
||||||
|
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
@ -18,7 +18,7 @@ public class ScriptTransformFactory extends TransformFactory<ScriptTransform, Sc
|
||||||
private final ScriptService scriptService;
|
private final ScriptService scriptService;
|
||||||
|
|
||||||
public ScriptTransformFactory(Settings settings, ScriptService scriptService) {
|
public ScriptTransformFactory(Settings settings, ScriptService scriptService) {
|
||||||
super(ServerLoggers.getLogger(ExecutableScriptTransform.class, settings));
|
super(Loggers.getLogger(ExecutableScriptTransform.class, settings));
|
||||||
this.scriptService = scriptService;
|
this.scriptService = scriptService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.transform.search;
|
package org.elasticsearch.xpack.watcher.transform.search;
|
||||||
|
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
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.NamedXContentRegistry;
|
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||||
|
@ -24,7 +24,7 @@ public class SearchTransformFactory extends TransformFactory<SearchTransform, Se
|
||||||
private final WatcherSearchTemplateService searchTemplateService;
|
private final WatcherSearchTemplateService searchTemplateService;
|
||||||
|
|
||||||
public SearchTransformFactory(Settings settings, Client client, NamedXContentRegistry xContentRegistry, ScriptService scriptService) {
|
public SearchTransformFactory(Settings settings, Client client, NamedXContentRegistry xContentRegistry, ScriptService scriptService) {
|
||||||
super(ServerLoggers.getLogger(ExecutableSearchTransform.class, settings));
|
super(Loggers.getLogger(ExecutableSearchTransform.class, settings));
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.defaultTimeout = settings.getAsTime("xpack.watcher.transform.search.default_timeout", TimeValue.timeValueMinutes(1));
|
this.defaultTimeout = settings.getAsTime("xpack.watcher.transform.search.default_timeout", TimeValue.timeValueMinutes(1));
|
||||||
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, xContentRegistry);
|
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, xContentRegistry);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.test;
|
package org.elasticsearch.xpack.watcher.test;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.license.XPackLicenseState;
|
import org.elasticsearch.license.XPackLicenseState;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
|
@ -36,7 +36,7 @@ public class TimeWarpedWatcher extends LocalStateCompositeXPackPlugin {
|
||||||
|
|
||||||
public TimeWarpedWatcher(final Settings settings, final Path configPath) throws Exception {
|
public TimeWarpedWatcher(final Settings settings, final Path configPath) throws Exception {
|
||||||
super(settings, configPath);
|
super(settings, configPath);
|
||||||
Logger logger = ServerLoggers.getLogger(TimeWarpedWatcher.class, settings);
|
Logger logger = Loggers.getLogger(TimeWarpedWatcher.class, settings);
|
||||||
logger.info("using time warped watchers plugin");
|
logger.info("using time warped watchers plugin");
|
||||||
|
|
||||||
TimeWarpedWatcher thisVar = this;
|
TimeWarpedWatcher thisVar = this;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.test.bench;
|
package org.elasticsearch.xpack.watcher.test.bench;
|
||||||
|
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentType;
|
import org.elasticsearch.common.xcontent.XContentType;
|
||||||
import org.elasticsearch.node.MockNode;
|
import org.elasticsearch.node.MockNode;
|
||||||
|
@ -207,7 +207,7 @@ public class WatcherExecutorServiceBenchmark {
|
||||||
|
|
||||||
public BenchmarkWatcher(Settings settings) {
|
public BenchmarkWatcher(Settings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
ServerLoggers.getLogger(BenchmarkWatcher.class, settings).info("using watcher benchmark plugin");
|
Loggers.getLogger(BenchmarkWatcher.class, settings).info("using watcher benchmark plugin");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.xpack.watcher.trigger;
|
package org.elasticsearch.xpack.watcher.trigger;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.logging.ServerLoggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
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.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -36,7 +36,7 @@ public class ScheduleTriggerEngineMock extends ScheduleTriggerEngine {
|
||||||
|
|
||||||
public ScheduleTriggerEngineMock(Settings settings, ScheduleRegistry scheduleRegistry, Clock clock) {
|
public ScheduleTriggerEngineMock(Settings settings, ScheduleRegistry scheduleRegistry, Clock clock) {
|
||||||
super(settings, scheduleRegistry, clock);
|
super(settings, scheduleRegistry, clock);
|
||||||
this.logger = ServerLoggers.getLogger(ScheduleTriggerEngineMock.class, settings);
|
this.logger = Loggers.getLogger(ScheduleTriggerEngineMock.class, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,7 +24,6 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue