Questions tagged [microsoft-extensions-logging]

53 questions
0
votes
1 answer

LogMetric not working with microsoft extension framework

I am using the logging extension framework in an asp.net core function app. I have following code: log.LogMetric("TESTER", 0); log.LogInformation($"{{logTypeStart}}: {service.GetType()}", logTypeStart); await…
Thomas Segato
  • 4,567
  • 11
  • 55
  • 104
0
votes
0 answers

Serilog - Cannot Close and Reopen Mapped Sinks in a Multi-threaded Application

I am evaluating replacing an existing logger in an existing test application. One of my potential candidates is Serilog. The application may start up to 16 threads and each thread is passed in the name of the log file to use. The threads during the…
0
votes
1 answer

How do I log a custom field in NLog to database using Microsoft.Extensions.Logging?

I am using Microsoft.Extensions.Logging together with NLog. My app is .NET Core 3.1. I would like to extend logging with custom fields. Is it possible or will I need to use NLog directly?
cashmere
  • 885
  • 3
  • 12
  • 37
0
votes
2 answers

Only write logs for custom logging

I am following this article: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1 I am trying to only log my own custom logging in a asp.net core 3.1 API. And not all logs generated from asp.net core. I have…
0
votes
1 answer

How to add global metadata to ASP.NET Core logging?

I'd like to add my app's build number to all logs in an ASP.NET Core 3.1 app that is using Application Insights for log storage. Is this possible without having to use BeginScope and EndScope everywhere? I assumed it would be part of the…
0
votes
1 answer

MSbuild fails when Using MS.Extns.DependencyInjection and MS.Extns.Logging on non dotnet core project (.net fx 4.6.2) due to assembly conflicts

I created a .net fx based asp.net web api 2 project, with which i attempted to use MS Dependency injection and MS logging assemblies from Microsoft.Extensions components. It works actually with non dotnet core based projects, providing Dependency…
0
votes
2 answers

Logging evaluation point

In DotNetCore Microsoft.Extensions.Logging If I set logging level to Information, will _logger.LogDebug(JsonConvert.SerializeObject(address)); evaluate JsonConvert.SerializeObject(address) part? If yes any idea how to prevent that so it won't…
cilerler
  • 9,010
  • 10
  • 56
  • 91
0
votes
1 answer

ASP.NET5 : Microsoft.Extensions.Logging to log in SQL Server

I am working on ASP.NET5 Project where I am using Microsoft.Extensions.Logging as logging framework. Here I want to provide the different options for logging.The User can select logging into a text file or Database(SQL Server) itself. I know how to…
1 2 3
4