I need to do an Azure .NET Profiler Trace on my .NET Core 2.1.1 web app.
Azure provides the following instructions on how to do this:
Ensure that you have the below code in your app's Program.cs as mentioned in Logging in ASP.NET Core article.
logging.AddEventSourceLogger();
Update the default LogLevel in appsettings.json to Information, like below
"Logging": { LogLevel": { Default": "Information" } }
However, there are no instructions for F#.
How can I add logging.AddEventSourceLogger(); to my Program.fs file?
open Microsoft.AspNetCore
open Microsoft.AspNetCore.Hosting
module Program =
let exitCode = 0
let CreateWebHostBuilder args =
WebHost
.CreateDefaultBuilder(args)
.UseStartup<Startup>();
[<EntryPoint>]
let main args =
CreateWebHostBuilder(args).Build().Run()
exitCode
You can add event source logger in
ConfigureLoggingextension method ofIWebHostBuilder: