You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
I'm using Microsoft.ApplicationInsights.WorkerService to push telemetry from .net core 2.2 windows worker service to application insights portal. I'm using Log4net third party provider for logging. Using the worker service package, I'm able to see the dependencies/SQL calls in application insights portal, but trace statements logged using log4net provider are missing in the portal. Upon debugging, I noticed log4net trace telemetry are marked as 'Unconfigured' and Instrumentation key is missing.
**Application Insights Telemetry (unconfigured)**: {"name":"Microsoft.ApplicationInsights.Message","time":"2019-09-26T16:40:51.9205695Z","tags":{"ai.cloud.roleInstance":"","ai.operation.id":"f584d91a7755cc43b7539aaadb43706f","ai.operation.parentId":"|f584d91a7755cc43b7539aaadb43706f.f61b1953f331a24a.","ai.operation.name":"Lifecycle Status Service","ai.internal.sdkVersion":"log4net:2.12.0-752"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"2019-09-26 12:40:51,920 [8] INFO 0 (null) > - Test Jithesh","severityLevel":"Information","properties":{"ClassName":"?","MethodName":"?","FileName":"?","LineNumber":"?","LoggerName":"Identifi.Network.LifeCycleStatus.Host.LifeCycleStatusService","ServiceRequestId":"0","Domain":"NOT AVAILABLE","Identity":"NOT AVAILABLE","ThreadName":"8"}}}}
The WorkerService SDK only configures one logging adaptor - iLogger, not anything else.
Log4NetAppender internally relies on TelemetryConfiguration.Active which is not setup by WorkerService.
You can make it work by setting TelemetryConfiguration.Active.InstrumentationKey. However, it (log4net logs) won't have the same config as other telemetry.
I'm using Microsoft.ApplicationInsights.WorkerService to push telemetry from .net core 2.2 windows worker service to application insights portal. I'm using Log4net third party provider for logging. Using the worker service package, I'm able to see the dependencies/SQL calls in application insights portal, but trace statements logged using log4net provider are missing in the portal. Upon debugging, I noticed log4net trace telemetry are marked as 'Unconfigured' and Instrumentation key is missing.
**Application Insights Telemetry (unconfigured)**: {"name":"Microsoft.ApplicationInsights.Message","time":"2019-09-26T16:40:51.9205695Z","tags":{"ai.cloud.roleInstance":"","ai.operation.id":"f584d91a7755cc43b7539aaadb43706f","ai.operation.parentId":"|f584d91a7755cc43b7539aaadb43706f.f61b1953f331a24a.","ai.operation.name":"Lifecycle Status Service","ai.internal.sdkVersion":"log4net:2.12.0-752"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"2019-09-26 12:40:51,920 [8] INFO 0 (null) > - Test Jithesh","severityLevel":"Information","properties":{"ClassName":"?","MethodName":"?","FileName":"?","LineNumber":"?","LoggerName":"Identifi.Network.LifeCycleStatus.Host.LifeCycleStatusService","ServiceRequestId":"0","Domain":"NOT AVAILABLE","Identity":"NOT AVAILABLE","ThreadName":"8"}}}}
But it works when adding a dependency
Application Insights Telemetry: {"name":"Microsoft.ApplicationInsights.Dev.7ac95097cd964541bb60e2243fb4cfb1.RemoteDependency","time":"2019-09-26T16:43:13.7914345Z","iKey":"7ac95097-cd96-4541-bb60-e2243fb4cfb1","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"5CD8279JVL","ai.operation.id":"f584d91a7755cc43b7539aaadb43706f","ai.operation.parentId":"|f584d91a7755cc43b7539aaadb43706f.f61b1953f331a24a.","ai.internal.sdkVersion":"rdddsc:2.11.0-21563","ai.internal.nodeName":""},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"HEAD /provider-verification-source-dv","id":"|f584d91a7755cc43b7539aaadb43706f.8726f2d0ceccef48.","data":"","duration":"00:00:00.0787428","resultCode":"200","success":true,"type":"Http","properties":{"DeveloperMode":"true","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')"}}}}
I following the steps mentioned in https://docs.microsoft.com/en-us/azure/azure-monitor/app/worker-service article. Could you please let me know if I'm missing anything?
The text was updated successfully, but these errors were encountered: