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


Java Logger.getLogger方法代码示例

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


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

示例1: Runner

import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
/**
 * Constructs a {@code Runner}
 * @throws ConfigurationException if there is a configuration issue
 */
public Runner() throws ConfigurationException {
    super();
    componentAgents = new LinkedList<Agent>();

    try {
        Config.init();
        Logger.init(Config.getValue("log_level", "info"),
                    Config.getValue("log_file_path", "logs"),
                    Config.getValue("log_file_name", "newrelic_plugin.log"),
                    getLogLimitInKilobytes());
        logger = Logger.getLogger(Runner.class);
        config = new SDKConfiguration();
    } catch (Exception e) {
        throw new ConfigurationException(e.getMessage());
    }
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:21,代码来源:Runner.java

示例2: ElasticsearchAgent

import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
public ElasticsearchAgent(String clusterName) {
    super(GUID, VERSION);
    this.clusterName = clusterName;
    this.logger = Logger.getLogger(ElasticsearchAgent.class);
}
 
开发者ID:s12v,项目名称:newrelic-elasticsearch,代码行数:6,代码来源:ElasticsearchAgent.java

示例3: init

import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Override
public void init(SubsetConfiguration conf) {
	debugEnabled = false;
	getGroupings = false;
	div = NewRelicMetrics.kMetricTreeDivider;
	categoryName = NewRelicMetrics.kCategoryMetricName;
	deltaName = NewRelicMetrics.kDeltaMetricName;
	overviewName = NewRelicMetrics.kOverviewMetricName;
	hadoopProcType = conf.getString("proctype", NewRelicMetrics.kDefaultAgentName);
	nrLicenseKey = conf.getString("nrlicensekey", "");  
	logger = Logger.getLogger(NewRelicSink.class);
	
	if (hadoopProcType.equals(NewRelicMetrics.kDefaultAgentName) && !conf.containsKey("enabled")) {
		logger.info("Monitoring disabled for this procees.");
		logger.info("Shutting down New Relic sink.");
		return;
	} else if ( "".equals(nrLicenseKey) || (nrLicenseKey == null)) {
		logger.info("No New Relic License Key given.");
		logger.info("Shutting down New Relic sink.");
		return;
	} else {
		context = buildContext(nrLicenseKey, conf.getString("hostname", ""), hadoopProcType);
		component = context.getComponents().next();
	}

	// Debug stuff
	if (conf.getString("debug", "false").equals("true")) {
		debugEnabled = true;
		logger.info("New Relic Sink: DEBUG enabled.");
	} 
	if (conf.getString("nrgroupings", "false").equals("true")) {
		getGroupings = true;
		metricGroupings = new HashMap<String, Integer>();
		logger.info("New Relic Sink: Getting Metric Groupings");
	}
	
	// For Insights
	nrInsightsKey = conf.getString("nrinsightskey", "");
	nrAccountId = conf.getString("nraccountid", "");		
	if ("".equals(nrInsightsKey) || (nrInsightsKey == null) ||
		"".equals(nrAccountId) || (nrAccountId == null)) {
		logger.info("No New Relic (Insights Insert Key || Account ID) given.");
		logger.info("Metrics will not be fed to insights.");
		useInsights = false;
	} else {
		logger.info("Insights metric recording is enabled!");
		useInsights = true;
		insightsService = InsightsService.withAccountId(nrAccountId)
				.withApiKey(nrInsightsKey)
				.withSsl(true);
	}
	
	// Initializing hashmaps to hold metrics
	metricNames = new HashMap<String, String[]>();
	oldMetricValues = new HashMap<String, Float>();
	insightsMetrics = new HashMap<String, Object>();
}
 
开发者ID:sschwartzman,项目名称:newrelic-hadoop-plugin,代码行数:58,代码来源:NewRelicSink.java

示例4: init

import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Override
public void init(SubsetConfiguration conf) {
	logger = Logger.getLogger(SimpleSink.class);
	logger.info("Simple monitoring enabled for this procees.");
	logger.info("Records and metrics will be written to this log.");
}
 
开发者ID:sschwartzman,项目名称:newrelic-hadoop-plugin,代码行数:7,代码来源:SimpleSink.java


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