use of com.newrelic.api.agent.Logger in project newrelic-java-agent by newrelic.
the class SolrMetricReporter_Instrumentation method init.
public void init(PluginInfo pluginInfo) {
Weaver.callOriginal();
Logger logger = NewRelic.getAgent().getLogger();
if (SolrJmxReporter.class.isInstance(this)) {
Object thisTemp = this;
SolrJmxReporter solrJMX = (SolrJmxReporter) thisTemp;
MBeanServer mBeanServer = solrJMX.getMBeanServer();
logger.log(Level.FINEST, "SolrJmxReporter mBeanServer: {0}", mBeanServer);
if (mBeanServer != null) {
AgentBridge.privateApi.addMBeanServer(mBeanServer);
logger.log(Level.FINEST, "added mBeanServer: {0}", mBeanServer);
}
}
}
use of com.newrelic.api.agent.Logger in project newrelic-java-agent by newrelic.
the class LinkingMetadata method readLinkingMetadata.
@Override
public Map<String, String> readLinkingMetadata() {
Agent agent = NewRelic.getAgent();
Logger logger = agent.getLogger();
logger.log(Level.INFO, "JMX LinkingMetadata: Fetching linking metadata from the agent...");
return agent.getLinkingMetadata();
}
use of com.newrelic.api.agent.Logger in project newrelic-java-agent by newrelic.
the class URLAnalyzerTest method testRunProcesses.
@Test
public void testRunProcesses() throws Exception {
JarData jarData = new JarData("foo", new JarInfo("1.2.3", Collections.<String, String>emptyMap()));
URL url = URI.create("https://example.com").toURL();
Logger logger = mock(Logger.class);
Function<URL, JarData> processor = mock(Function.class);
Consumer<JarData> consumer = mock(Consumer.class);
when(processor.apply(url)).thenReturn(jarData);
URLAnalyzer testClass = new URLAnalyzer(url, processor, consumer, logger);
testClass.run();
verify(consumer).accept(jarData);
}
use of com.newrelic.api.agent.Logger in project newrelic-java-agent by newrelic.
the class URLAnalyzerTest method testProcessingSkipsNull.
@Test
public void testProcessingSkipsNull() throws Exception {
URL url = URI.create("https://example.com").toURL();
Logger logger = mock(Logger.class);
Function<URL, JarData> processor = mock(Function.class);
Consumer<JarData> consumer = mock(Consumer.class);
when(processor.apply(url)).thenReturn(null);
URLAnalyzer testClass = new URLAnalyzer(url, processor, consumer, logger);
testClass.run();
verifyNoMoreInteractions(consumer);
}
use of com.newrelic.api.agent.Logger in project newrelic-java-agent by newrelic.
the class LinkingMetadataRegistrationTest method setup.
@Before
public void setup() throws Exception {
name = new ObjectName(MBEAN_NAME);
logger = mock(Logger.class);
fakeServer = mock(MBeanServer.class);
}
Aggregations