microsoft-extensions-logging Questions

1

I want to get certain key bits of information (service-name, service-version, host-name, etc) logged on every log message in an ASP.Net Core service. I have the following code: public class Progr...
Dogmatize asked 13/1, 2020 at 16:25

3

Solved

I'm using Serilog 2.10.0 for logging in an ASP.NET Core Application on .NET 5. I'm running into a problem when trying to log an event where there is only one parameter and this parameter is an arra...
Leanaleanard asked 22/2, 2021 at 14:21

2

Solved

I am using NLog as logging provider in my solution, but some projects have migrated to Microsoft.Extensions.Logging. We're still evaluating if migrating also the rest of the code to this, but in th...
Clarkia asked 18/5, 2022 at 7:56

2

Solved

I'm using NLog.Extensions.Logging. When registering a logger factory using the method AddNLog(), it is possible to enable logging scope using NLogProviderOptions.IncludeScopes. But how to make ...
Lindbom asked 20/2, 2020 at 17:42

2

Solved

I see a lot of posts mentioning usage of Microsoft.Extensions.Logging together with NLog. I'd like to better understand what Microsoft.Extensions.Logging is used for? And specifically why is it...
Alkanet asked 2/10, 2019 at 20:41

1

Solved

Our function delegates all the logic to another class "CreateHandler" where we use the ILogger through DI. The function logs properly but the CreateHandler does not. Locally we verified t...

1

Solved

I'm using Serilog.Extensions.Logging and outputting to console with this outputTemplate: "{Timestamp:HH:mm} [{Level:u3}] {Message} {Properties:j} {NewLine}" What I would like to see, is that comp...
Irradiance asked 15/1, 2020 at 10:4

2

Solved

This question is related to Steven’s answer - here. He proposed a very good logger wrapper. I will paste his code below: public interface ILogger { void Log(LogEntry entry); } public static clas...
Plantaineater asked 21/9, 2016 at 7:27

2

Solved

How can I log to file in Asp.Net 5 RC1? I couldn't find any solution with Microsoft.Extensions.Logging. Is there any solution which is compatible with .Net Core 5 (DNX Core 5.0)? I also was trying ...
Unproductive asked 27/1, 2016 at 13:6

4

I found a CodeProject with an example of how to get this to work, but it doesn't work. The main problem seems to be that the "Microsoft.Framework.Logging.NLog": "1.0.0-*" package doesn't seem to ex...

1

Solved

I have a simple test project to experiment with logging with NetCore 2.0 using the Microsoft Logging Extensions package. The problem I'm having is that when I run my app the very first time, it lo...
Hilariohilarious asked 13/9, 2017 at 1:3

2

I have the following code to set up logging to database using NLog. I use an Alpha version of NLog.Extension.Logging. Is it possible to let the built-in log framework log to database so I don't nee...

2

Solved

I'm working with a project which utilizes Simple Injector as dependency injector. On the other hand, this project uses Microsoft.Extensions.Logging in order to log the events that occurs in certain...

1

Solved

I am working on an application, and I got an error in Startup.cs partial classes, and I cant find why this error shows up: The call is ambiguous between the following methods or properties: Micro...
Encarnalize asked 12/7, 2016 at 11:10
1

© 2022 - 2024 — McMap. All rights reserved.