Как только вы установите ApplicationInsight пакет nuget и добавите InstrumentationKey
в свой конфигурационный файл, вы готовы к пу sh журналам приложений в Azure.
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
[RequestSizeLimit(40000000)]
public IEnumerable<WeatherForecast> Get()
{
try
{
}
catch (Exception ex)
{
_logger.LogError(ex.Message, ex);
}
}
Вы можете просмотреть все данные вашего журнала в ApplicationInsights traces
и коллекции `Exceptions '