Skip to content

Commit

Permalink
Merge pull request #1012 from microsoft/agent-diagnostic-logging
Browse files Browse the repository at this point in the history
Better agent diagnostic logging
  • Loading branch information
trask authored Aug 20, 2019
2 parents 9fa1282 + b78f163 commit a811128
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ private MainEntryPoint() {
public static void premain(Instrumentation instrumentation, File agentJarFile) {
try {
startupLogger = initLogging(instrumentation, agentJarFile);
startupLogger.info("ApplicationInsights agent starting...");
start(instrumentation, agentJarFile);
startupLogger.info("ApplicationInsights agent started");
} catch (ThreadDeath td) {
throw td;
} catch (Throwable t) {
Expand Down
4 changes: 1 addition & 3 deletions agent/src/main/resources/ai.logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.glowroot.instrumentation" level="info" />
<logger name="com.microsoft.applicationinsights.agent.shadow" level="warn" />
<root level="info">
<root level="${applicationInsights.agent.logging.level:-error}">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ public void init(FilterConfig config) {
handler = new HttpServerHandler(new ApplicationInsightsServletExtractor(), webModulesContainer,
cleaners, telemetryClient);
if (AgentBridgeFactory.isAgentAvailable()) {
InternalLogger.INSTANCE.info("Agent is running");
agentBridge = AgentBridgeFactory.create(new SdkBridgeFactory() {
public SdkBridge create() {
return new SdkBridgeImpl(telemetryClient);
}
});
} else {
InternalLogger.INSTANCE.info("Agent is not running");
agentBridge = AgentBridgeFactory.create();
}
if (StringUtils.isNotEmpty(config.getFilterName())) {
Expand Down

0 comments on commit a811128

Please sign in to comment.