0
votes

I've an ASP.NET Core Application (.net Framework) and that references my other .net Framework dlls. I've configured logging in my ASP.NET Application using "Microsoft.Extensions.Logging.AzureAppServices" and injecting ILogger to controllers. All that works fine. all my logs are written to azure application logs in Azure.

In my .net framework dll, i've Trace.TraceError, TraceWarning statements. And I would like to include them in azure application log. but I cannot find any way to do it.

Looking forward for some help.

1
Why not using ApplicationInsight?Martin Brandl
I cannot at this moment. I need to avoid the change in my .net framework dll. The dll already has got necessary Trace statements. and i need a way to somehow include them in the logs.Himal Patel
Which trace system are you using in the .NET Framework class library/DLL? The Trace class or the TraceSource one?Henk Mollema
I'm using Trace. (System.Diagnostics)Himal Patel
That trace system is not compatible with ASP.NET Core. There is a logging provider for TraceSource though.Henk Mollema

1 Answers

0
votes

You will have to use the logging framework of ASP.NET Core (ILogger and friends) in your .NET Framework class library/DLL if you want them appear in the same application log.

Another option might be to convert the library to use the TraceSource system, there is a logging provider for ASP.NET Core available. If you're unable to make changes to the existing library, I'm afraid you're out of options.