本文整理汇总了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());
}
}
示例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);
}
示例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>();
}
示例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.");
}