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


Java ESLogger.info方法代碼示例

本文整理匯總了Java中org.elasticsearch.common.logging.ESLogger.info方法的典型用法代碼示例。如果您正苦於以下問題:Java ESLogger.info方法的具體用法?Java ESLogger.info怎麽用?Java ESLogger.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.common.logging.ESLogger的用法示例。


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

示例1: checkUnsetAndMaybeExit

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
private static void checkUnsetAndMaybeExit(String confFileSetting, String settingName) {
    if (confFileSetting != null && confFileSetting.isEmpty() == false) {
        ESLogger logger = Loggers.getLogger(Bootstrap.class);
        logger.info("{} is no longer supported. crate.yml must be placed in the config directory and cannot be renamed.", settingName);
        System.exit(1);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:BootstrapProxy.java

示例2: main

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
public static void main(String[] args) {
    System.setProperty("es.foreground", "yes");
    String[] startArgs = new String[args.length + 1];
    startArgs[0] = "start";
    System.arraycopy(args, 0, startArgs, 1, args.length);
    try {
        BootstrapProxy.init(startArgs);
    } catch (Throwable t) {
        // format exceptions to the console in a special way
        // to avoid 2MB stacktraces from guice, etc.
        throw new StartupErrorProxy(t);
    }

    // start mysql server
    Settings settings = BootstrapProxy.getSettings();
    int maxConectNum = settings.getAsInt("mysql.max_connections", 1024);
    int mysqlPort = settings.getAsInt("mysql.port", 8306);
    ConnectScheduler scheduler = new ConnectScheduler(maxConectNum);
    MysqlServer mysqlServer = new MysqlServer(mysqlPort, scheduler);
    ESLogger logger = Loggers.getLogger(CrateF.class);
    if (!mysqlServer.start()) {
        logger.error("mysql server start failed");
        System.exit(-1);
    } else {
        logger.info("mysql server start successful, max_connections: "
                + maxConectNum + " port: " + mysqlPort);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:29,代碼來源:CrateF.java

示例3: stop

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
private Node stop() {
    if (!lifecycle.moveToStopped()) {
        return this;
    }
    ESLogger logger = Loggers.getLogger(Node.class, settings.get("name"));
    logger.info("stopping ...");

    injector.getInstance(TribeService.class).stop();
    injector.getInstance(ResourceWatcherService.class).stop();
    if (settings.getAsBoolean("http.enabled", true)) {
        injector.getInstance(HttpServer.class).stop();
    }

    injector.getInstance(SnapshotsService.class).stop();
    injector.getInstance(SnapshotShardsService.class).stop();
    // stop any changes happening as a result of cluster state changes
    injector.getInstance(IndicesClusterStateService.class).stop();
    // we close indices first, so operations won't be allowed on it
    injector.getInstance(IndexingMemoryController.class).stop();
    injector.getInstance(IndicesTTLService.class).stop();
    injector.getInstance(RoutingService.class).stop();
    injector.getInstance(ClusterService.class).stop();
    injector.getInstance(DiscoveryService.class).stop();
    injector.getInstance(MonitorService.class).stop();
    injector.getInstance(GatewayService.class).stop();
    injector.getInstance(SearchService.class).stop();
    injector.getInstance(RestController.class).stop();
    injector.getInstance(TransportService.class).stop();

    for (Class<? extends LifecycleComponent> plugin : pluginsService.nodeServices()) {
        injector.getInstance(plugin).stop();
    }
    // we should stop this last since it waits for resources to get released
    // if we had scroll searchers etc or recovery going on we wait for to finish.
    injector.getInstance(IndicesService.class).stop();
    logger.info("stopped");

    return this;
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:40,代碼來源:Node.java

示例4: checkUnsetAndMaybeExit

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
private static void checkUnsetAndMaybeExit(String confFileSetting, String settingName) {
    if (confFileSetting != null && confFileSetting.isEmpty() == false) {
        ESLogger logger = Loggers.getLogger(Bootstrap.class);
        logger.info("{} is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed.", settingName);
        exit(1);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:Bootstrap.java

示例5: checkPermission

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
public static boolean checkPermission(final HttpRequest request, final HttpChannel channel, ESAuthConfig config, ESLogger logger) {
	/*
	//config reload
	if (request.paramAsBoolean("auth_reload", false)) {
		config.reloadConfig();
		logger.info("reload auth config");
	}
	*/
	
	// 是否開啟認證授權
	boolean open_auth = config.getSet().getAsBoolean("open_auth", false);
	if (!open_auth) {
		return true;
	}
	
	String authStr = "";
	if (request != null) {
		authStr = Tool.base64Decode(request.param("auth", ""));
	}
	// logger.info("authStr:" + authStr);
	
	String[] authArr = authStr.split(":");
	if (authArr.length != 2) {
		logger.info("Auth failed: invalid auth");
		respForbidden(request, channel, logger);
		return false;
	}
	String user_username = authArr[0].trim();
	String config_username = config.getSet().get("username", "").trim();
	
	String user_password = authArr[1].trim();
	String config_password = config.getSet().get("password", "").trim();
	
	// logger.info("user_username:" + user_username);
	// logger.info("config_username:" + config_username);
	// logger.info("user_password:" + user_password);
	// logger.info("config_password:" + config_password);
	
	if (!user_username.equals(config_username) || !user_password.equals(config_password)) {
		logger.info("Auth failed: username[" + user_username + "] password[" + user_password + "]");
		respForbidden(request, channel, logger);
		return false;
	}
	return true;
}
 
開發者ID:ghostboyzone,項目名稱:ESAuthPlugin,代碼行數:46,代碼來源:ContentBuilder.java

示例6: checkIpPermission

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
public static boolean checkIpPermission(final HttpRequest request, final HttpChannel channel, ESAuthConfig config, ESLogger logger) {
	// 是否開啟ip授權
	boolean open_ip_auth = config.getSet().getAsBoolean("open_ip_auth", false);
	if (!open_ip_auth) {
		return true;
	}
	String[] ip_auth_list = config.getSet().getAsArray("ip_auth_list", new String[0]);
	
	
	// logger.info("LocalAddr:" + request.getLocalAddress().toString());
	// logger.info("RemoteAddr:" + request.getRemoteAddress().toString());
	InetSocketAddress localAddr = (InetSocketAddress) request.getLocalAddress();
	InetSocketAddress remoteAddr = (InetSocketAddress) request.getRemoteAddress();
	
	boolean has_local = false;
	boolean has_auth_ip = false;
	for(String ip : ip_auth_list) {
		if (ip.equals("local")
			|| ip.equals("localhost")
			|| ip.equals("127.0.0.1")) {
			has_local = true;
		}
		if (ip.equals(remoteAddr.getHostName())) {
			has_auth_ip = true;
		}
		logger.info("ip: " + ip + ", me: " + remoteAddr.getHostName() );
	}
	
	if (localAddr.getHostName().equals(remoteAddr.getHostName())) {
		logger.info("Local Request");
		
		if (!has_local) {
			// respIpForbidden(request, channel, logger);
			return true;
		}
	} else {
		logger.info("Local:" + localAddr.getHostName());
		logger.info("Remote:" + remoteAddr.getHostName());
		
		if (!has_auth_ip) {
			logger.info("Ip Auth failed: ip[" + remoteAddr.getHostName() + "]");
			respIpForbidden(request, channel, logger);
			return false;
		}
	}
	return true;
}
 
開發者ID:ghostboyzone,項目名稱:ESAuthPlugin,代碼行數:48,代碼來源:ContentBuilder.java

示例7: CrateRestFilter

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
@Inject
public CrateRestFilter(Settings settings) {
    this.esApiEnabled = settings.getAsBoolean(ES_API_ENABLED_SETTING, true);
    ESLogger logger = Loggers.getLogger(getClass().getPackage().getName(), settings);
    logger.info("Elasticsearch HTTP REST API {}enabled", esApiEnabled ? "" : "not ");
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:7,代碼來源:CrateRestFilter.java

示例8: start

import org.elasticsearch.common.logging.ESLogger; //導入方法依賴的package包/類
/**
 * Start the node. If the node is already started, this method is no-op.
 */
public Node start() {
    if (!lifecycle.moveToStarted()) {
        return this;
    }

    ESLogger logger = Loggers.getLogger(Node.class, settings.get("name"));
    logger.info("starting ...");
    // hack around dependency injection problem (for now...)
    injector.getInstance(Discovery.class).setRoutingService(injector.getInstance(RoutingService.class));
    for (Class<? extends LifecycleComponent> plugin : pluginsService.nodeServices()) {
        injector.getInstance(plugin).start();
    }

    injector.getInstance(MappingUpdatedAction.class).setClient(client);
    injector.getInstance(IndicesService.class).start();
    injector.getInstance(IndexingMemoryController.class).start();
    injector.getInstance(IndicesClusterStateService.class).start();
    injector.getInstance(IndicesTTLService.class).start();
    injector.getInstance(SnapshotsService.class).start();
    injector.getInstance(SnapshotShardsService.class).start();
    injector.getInstance(RoutingService.class).start();
    injector.getInstance(SearchService.class).start();
    injector.getInstance(MonitorService.class).start();
    injector.getInstance(RestController.class).start();

    // TODO hack around circular dependencies problems
    injector.getInstance(GatewayAllocator.class).setReallocation(injector.getInstance(ClusterService.class), injector.getInstance(RoutingService.class));

    injector.getInstance(ResourceWatcherService.class).start();
    injector.getInstance(GatewayService.class).start();
    injector.getInstance(TenantManagementService.class).start();

    // Start the transport service now so the publish address will be added to the local disco node in ClusterService
    TransportService transportService = injector.getInstance(TransportService.class);
    transportService.start();
    injector.getInstance(ClusterService.class).start();

    // start after cluster service so the local disco is known
    DiscoveryService discoService = injector.getInstance(DiscoveryService.class).start();


    transportService.acceptIncomingRequests();
    discoService.joinClusterAndWaitForInitialState();

    if (settings.getAsBoolean("http.enabled", true)) {
        injector.getInstance(HttpServer.class).start();
    }
    injector.getInstance(TribeService.class).start();
    if (settings.getAsBoolean("node.portsfile", false)) {
        if (settings.getAsBoolean("http.enabled", true)) {
            HttpServerTransport http = injector.getInstance(HttpServerTransport.class);
            writePortsFile("http", http.boundAddress());
        }
        TransportService transport = injector.getInstance(TransportService.class);
        writePortsFile("transport", transport.boundAddress());
    }
    logger.info("started");

    return this;
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:64,代碼來源:Node.java


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