diff --git a/Directory.Packages.props b/Directory.Packages.props index 077c7c6c..3b7ba907 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,6 @@ - @@ -20,7 +19,7 @@ - + diff --git a/src/LondonTravel.Skill/AlexaFunction.cs b/src/LondonTravel.Skill/AlexaFunction.cs index 00cb5b76..31ccda54 100644 --- a/src/LondonTravel.Skill/AlexaFunction.cs +++ b/src/LondonTravel.Skill/AlexaFunction.cs @@ -105,12 +105,9 @@ protected virtual void ConfigureServices(IServiceCollection services) { services.AddLogging((builder) => { - var options = new LambdaLoggerOptions() - { - Filter = FilterLogs, - }; - - builder.AddLambdaLogger(options); + builder.SetMinimumLevel(LogLevel.Information) + .AddFilter(FilterLogs) + .AddJsonConsole(); }); services.AddHttpClients(); @@ -178,7 +175,8 @@ private static bool FilterLogs(string name, LogLevel level) { if (level < LogLevel.Warning && (name.StartsWith("System.", StringComparison.Ordinal) || - name.StartsWith("Microsoft.", StringComparison.Ordinal))) + name.StartsWith("Microsoft.", StringComparison.Ordinal) || + name.StartsWith("Polly", StringComparison.Ordinal))) { return false; } diff --git a/src/LondonTravel.Skill/LondonTravel.Skill.csproj b/src/LondonTravel.Skill/LondonTravel.Skill.csproj index 64281610..87e78e2f 100644 --- a/src/LondonTravel.Skill/LondonTravel.Skill.csproj +++ b/src/LondonTravel.Skill/LondonTravel.Skill.csproj @@ -11,7 +11,6 @@ - @@ -19,7 +18,7 @@ - + diff --git a/test/LondonTravel.Skill.Tests/FunctionTests.cs b/test/LondonTravel.Skill.Tests/FunctionTests.cs index 47d59df4..caba4e75 100644 --- a/test/LondonTravel.Skill.Tests/FunctionTests.cs +++ b/test/LondonTravel.Skill.Tests/FunctionTests.cs @@ -152,7 +152,7 @@ private sealed class TestAlexaFunction( protected override void ConfigureServices(IServiceCollection services) { - services.AddLogging((builder) => builder.AddXUnit(this)); + services.AddLogging((builder) => builder.AddXUnit(this).SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Debug)); services.AddSingleton(config); services.AddSingleton( (_) => new HttpRequestInterceptionFilter(options));