응용 프로그램 인사이트에 사용자 지정 이벤트를 보내려는 콘솔 응용 프로그램이 있습니다. Application Insight NLog 대상 (https://www.nuget.org/packages/Microsoft.ApplicationInsights.NLogTarget/)을 사용하고 싶지만 작동하지 않습니다. 나는 .config 파일을 통해 설정을 시도하고 수동으로 설정하려고 :응용 프로그램 통찰력 NLog 대상
var config = new LoggingConfiguration();
ConfigurationItemFactory.Default.Targets.RegisterDefinition("ai", typeof(ApplicationInsightsTarget));
ApplicationInsightsTarget aiTarget = new ApplicationInsightsTarget();
aiTarget.InstrumentationKey = "my_key";
aiTarget.Name = "aiTarget";
LoggingRule rule = new LoggingRule("*", LogLevel.Info, aiTarget);
config.AddTarget("aiTarget", aiTarget);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
하지만 여전히 아무것도, 나는 응용 프로그램의 통찰력에 내 예외 또는 이벤트를 볼 수 없습니다. 어떤 아이디어? 그런 다음
var config = new LoggingConfiguration();
ApplicationInsightsTarget target = new ApplicationInsightsTarget();
// You need this only if you did not define InstrumentationKey in ApplicationInsights.config or want to use different instrumentation key
target.InstrumentationKey = "Your_Resource_Key";
LoggingRule rule = new LoggingRule("*", LogLevel.Trace, target);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
Logger logger = LogManager.GetLogger("Example");
logger.Trace("trace log message");
아무것도가 dc.services에있는 상자에서 보내지는 경우, 내가 피들러와 함께 한 번 확인을 거라고 :