diff --git a/fsharp/giraffe-endpoints/Program.fs b/fsharp/giraffe-endpoints/Program.fs index a50be6e28a1..44782327233 100644 --- a/fsharp/giraffe-endpoints/Program.fs +++ b/fsharp/giraffe-endpoints/Program.fs @@ -2,6 +2,7 @@ open Microsoft.AspNetCore.Builder open Microsoft.AspNetCore.Hosting open Microsoft.Extensions.DependencyInjection open Microsoft.Extensions.Hosting +open Microsoft.Extensions.Logging open Giraffe open Giraffe.EndpointRouting @@ -24,6 +25,10 @@ let configureApp (app: IApplicationBuilder) = .UseEndpoints(fun e -> e.MapGiraffeEndpoints(webApp)) |> ignore +let configureLogging (log : ILoggingBuilder) = + log.ClearProviders() + |> ignore + let configureServices (services: IServiceCollection) = services.AddRouting() |> ignore let args = System.Environment.GetCommandLineArgs() @@ -33,6 +38,7 @@ Host .ConfigureWebHost(fun webHost -> webHost .UseKestrel() + .ConfigureLogging(configureLogging) .ConfigureServices(configureServices) .Configure(configureApp) |> ignore) diff --git a/fsharp/giraffe/Program.fs b/fsharp/giraffe/Program.fs index 2e53a5c2b78..f9f98c5dea1 100644 --- a/fsharp/giraffe/Program.fs +++ b/fsharp/giraffe/Program.fs @@ -3,6 +3,7 @@ open Microsoft.AspNetCore.Builder open Microsoft.AspNetCore.Hosting open Microsoft.Extensions.DependencyInjection open Microsoft.Extensions.Hosting +open Microsoft.Extensions.Logging open Giraffe // --------------------------------- @@ -21,6 +22,10 @@ let webApp: HttpFunc -> HttpFunc = let configureApp (app: IApplicationBuilder) = app.UseGiraffe(webApp) +let configureLogging (log : ILoggingBuilder) = + log.ClearProviders() + |> ignore + let configureServices (services: IServiceCollection) = services.AddGiraffe() |> ignore let args = System.Environment.GetCommandLineArgs() @@ -28,6 +33,7 @@ let args = System.Environment.GetCommandLineArgs() Host.CreateDefaultBuilder(args) .ConfigureWebHost(fun webHost -> webHost.UseKestrel() + .ConfigureLogging(configureLogging) .ConfigureServices(configureServices) .Configure(Action configureApp) |> ignore)