I would like to add custom property to application insight which is coming in applicaion header. Is there a way to do without making much changes in existing code?
I have configured the loggin in my .net core application as below.
`services.AddLogging(options => { options.AddFilter("", _logLevel);
// pass the InstrumentationKey provided under the appsettings
options.AddApplicationInsights(Configuration["AppInsightInstrumentKey"]);
});`
And to write the logs I have called the function as
private readonly ILogger<MyController> _logger; _logger.LogError(ex.ToString());
I would like to add custom property to application insight which is coming in applicaion header. Is there a way to do without making much changes in existing code?
i would like to use same method _logger.LogError and it should add customer properties as well.
Microsoft.Extensions.Logging.ApplicationInsights
.For Exception: