diff --git a/api/appsettings.json b/api/appsettings.json index aa57e13..80f5c9a 100644 --- a/api/appsettings.json +++ b/api/appsettings.json @@ -58,6 +58,7 @@ ] }, "Logging": { + "LogEnvironmentOnStartup": true, "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning", @@ -65,8 +66,7 @@ "Microsoft.AspNetCore.Routing": "Warning", "System.Net.Http.HttpClient": "Warning", "Api": "Information" - }, - "LogEnvironmentOnStartup": true + } }, "AllowedHosts": "*", "KeyVault": { diff --git a/cv-matcher-api/appsettings.json b/cv-matcher-api/appsettings.json index a7765a2..1c4fc29 100644 --- a/cv-matcher-api/appsettings.json +++ b/cv-matcher-api/appsettings.json @@ -58,6 +58,7 @@ ] }, "Logging": { + "LogEnvironmentOnStartup": true, "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning", @@ -65,8 +66,7 @@ "Microsoft.AspNetCore.Routing": "Warning", "System.Net.Http.HttpClient": "Warning", "Api": "Information" - }, - "LogEnvironmentOnStartup": true + } }, "AllowedHosts": "*", "KeyVault": { diff --git a/cv-matcher-api/cv-matcher-api.csproj b/cv-matcher-api/cv-matcher-api.csproj index 2c70231..09be60c 100644 --- a/cv-matcher-api/cv-matcher-api.csproj +++ b/cv-matcher-api/cv-matcher-api.csproj @@ -16,6 +16,7 @@ + diff --git a/rag-api/appsettings.json b/rag-api/appsettings.json index 5a61b9a..2f0c083 100644 --- a/rag-api/appsettings.json +++ b/rag-api/appsettings.json @@ -1,17 +1,78 @@ { - "AllowedHosts": "*", "Serilog": { + "Using": [ + "Serilog.Sinks.Console", + "Serilog.Sinks.File", + "Serilog.Sinks.Email" + ], "MinimumLevel": { "Default": "Information", "Override": { "Microsoft.AspNetCore": "Warning", - "System.Net.Http.HttpClient": "Warning" + "Microsoft.AspNetCore.Hosting": "Information", + "Microsoft.AspNetCore.Routing": "Warning", + "System.Net.Http.HttpClient": "Warning", + "Api": "Information" } }, "WriteTo": [ - { "Name": "Console" } + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext}: {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "logs/api-.log", + "rollingInterval": "Day", + "retainedFileCountLimit": 30, + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {SourceContext}: {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "Email", + "Args": { + "restrictedToMinimumLevel": "Error", + "fromEmail": "", + "toEmail": "", + "mailServer": "", + "networkCredential": { + "userName": "", + "password": "" + }, + "port": 587, + "enableSsl": true, + "emailSubject": "[mihes.ro API] Error Alert", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}", + "batchPostingLimit": 10, + "period": "0.00:05:00" + } + } + ], + "Enrich": [ + "FromLogContext", + "WithMachineName", + "WithEnvironmentName" ] }, + "Logging": { + "LogEnvironmentOnStartup": true, + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.AspNetCore.Hosting": "Information", + "Microsoft.AspNetCore.Routing": "Warning", + "System.Net.Http.HttpClient": "Warning", + "Api": "Information" + } + }, + "AllowedHosts": "*", + "KeyVault": { + "VaultUri": "", + "Enabled": false + }, "ConnectionStrings": { "RagDb": "Server=localhost,1433;Database=MyAiRag;User Id=sa;Password=Your_strong_password123;TrustServerCertificate=True" }, diff --git a/rag-api/rag-api.csproj b/rag-api/rag-api.csproj index 289ed9c..d76b094 100644 --- a/rag-api/rag-api.csproj +++ b/rag-api/rag-api.csproj @@ -16,6 +16,7 @@ +