diff --git a/backend/api/Configurations/ConfigurationBuilderExtensions.cs b/backend/api/Configurations/ConfigurationBuilderExtensions.cs index 8ed6a198e..ba533158f 100644 --- a/backend/api/Configurations/ConfigurationBuilderExtensions.cs +++ b/backend/api/Configurations/ConfigurationBuilderExtensions.cs @@ -29,5 +29,20 @@ public static void AddAzureEnvironmentVariables(this WebApplicationBuilder build Console.WriteLine("'AZURE_TENANT_ID' set to " + tenantId); } } + + /// + /// Configures the logger used by the application + /// + /// + /// + public static void ConfigureLogger(this WebApplicationBuilder builder) + { + builder.Logging.AddSimpleConsole(options => + { + options.IncludeScopes = true; + options.TimestampFormat = "yyyy-MM-dd HH:mm:ss - "; + options.ColorBehavior = Microsoft.Extensions.Logging.Console.LoggerColorBehavior.Enabled; + }); + } } } diff --git a/backend/api/Program.cs b/backend/api/Program.cs index 1e704b165..766863c54 100644 --- a/backend/api/Program.cs +++ b/backend/api/Program.cs @@ -13,6 +13,7 @@ var builder = WebApplication.CreateBuilder(args); builder.AddAzureEnvironmentVariables(); +builder.ConfigureLogger(); builder.Services.ConfigureDatabase(builder.Configuration);