From 90ccdc0b976835cef3b41e5b9c6efe3d44b39dc9 Mon Sep 17 00:00:00 2001 From: Carl Sixsmith Date: Wed, 7 Aug 2024 15:04:34 +0100 Subject: [PATCH] Adjust settings to log out to text files, console and sentry (disabled by default in dev) --- .vscode/launch.json | 11 ---- .vscode/tasks.json | 14 ----- docker-compose.yml | 12 ----- src/Infrastructure/Infrastructure.csproj | 1 - src/Server.UI/appsettings.Development.json | 28 ---------- src/Server.UI/appsettings.json | 59 +++++++++++++++------- 6 files changed, 40 insertions(+), 85 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 943aa103..8afdac8a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,17 +21,6 @@ "/Views": "${workspaceFolder}/src/Server.UI/Views" } }, - { - "name": "Launch Build Console App", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "Build (Build Project)", - "program": "${workspaceFolder}/build/bin/Debug/net8.0/Build.dll", - "args": [], - "cwd": "${workspaceFolder}/build", - "stopAtEntry": false, - "console": "internalConsole" - }, { "name": ".net Core Attach", "type": "coreclr", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 22399d9d..fd90a75f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -14,20 +14,6 @@ "kind": "build", "isDefault": true } - }, - { - "label": "Build (Build Project)", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/build/Build.csproj" - ], - "problemMatcher": "$msCompile", - "group":{ - "kind": "build", - "isDefault": true - } } ] } \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 6e1ea801..c095daab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,4 @@ services: - seq: - image: datalust/seq - container_name: seq - environment: - ACCEPT_EULA: "Y" - ports: - - "5341:80" - volumes: - - seq_data:/data - sqlserver: image: mcr.microsoft.com/mssql/server:2022-latest container_name: sqlserver @@ -22,7 +12,5 @@ services: - sqlserver_data:/var/opt/mssql volumes: - seq_data: - driver: local sqlserver_data: driver: local diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj index f57172eb..aa935a46 100644 --- a/src/Infrastructure/Infrastructure.csproj +++ b/src/Infrastructure/Infrastructure.csproj @@ -35,7 +35,6 @@ - diff --git a/src/Server.UI/appsettings.Development.json b/src/Server.UI/appsettings.Development.json index 9a85078b..a5362cc9 100644 --- a/src/Server.UI/appsettings.Development.json +++ b/src/Server.UI/appsettings.Development.json @@ -4,33 +4,5 @@ "AllowedIPs": [ "::1" ] - }, - "Serilog": { - "Using": ["Serilog.Sinks.Console", "Sentry.Serilog"], - "MinimumLevel": { - "Default": "Debug", - "Override": { - "Microsoft": "Information", - "System": "Information" - } - }, - "WriteTo": [ - { - "Name": "Console", - "Args": { - "restrictedToMinimumLevel": "Debug" - } - }, - { - "Name": "Seq", - "Args": { - "serverUrl": "http://localhost:5341" - } - } - ], - "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ], - "Properties": { - "Application": "CATS" - } } } \ No newline at end of file diff --git a/src/Server.UI/appsettings.json b/src/Server.UI/appsettings.json index fdfab86c..1db24c3d 100644 --- a/src/Server.UI/appsettings.json +++ b/src/Server.UI/appsettings.json @@ -14,28 +14,51 @@ } }, "Serilog": { - "Using": [ "Serilog.Sinks.Console", "Sentry.Serilog" ], + "Using": [ + "Serilog.Sinks.Console", + "Sentry.Serilog" + ], "MinimumLevel": { - "Default": "Information", + "Default": "Debug", "Override": { - "Microsoft": "Warning", - "System": "Warning" + "Microsoft": "Information", + "System": "Information", + "MudBlazor": "Information", + "ActualLab": "Information" } }, "WriteTo": [ { "Name": "Console" - }//, - //{ - // "Name": "Sentry", - // "Args": { - // "dsn": "your-sentry-dsn", - // "minimumBreadcrumbLevel": "Information", - // "minimumEventLevel": "Error", - // "sendDefaultPii": true - // } - //} - ] + }, + { + "Name": "File", + "Args": { + "path": "../../logs/log-.txt", + "rollingInterval": "Day", + "restrictedToMinimumLevel": "Debug" + } + }, + { + "Name": "Sentry", + "Args": { + "dsn": "", + "minimumBreadcrumbLevel": "Information", + "minimumEventLevel": "Error", + "sendDefaultPii": true, + "Release": "1.0.1-dev", + "Environment": "Development" + } + } + ], + "Enrich": [ + "FromLogContext", + "WithMachineName", + "WithThreadId" + ], + "Properties": { + "Application": "CATS" + } }, "IdentitySettings": { "RequireDigit": true, @@ -52,9 +75,7 @@ "EmailTemplate": "" }, "AllowlistOptions": { - "AllowedIPs": [ - - ] + "AllowedIPs": [] }, "DMS": { "ApplicationUrl": "", @@ -65,7 +86,7 @@ "AccessKey": "", "SecretKey": "", "Bucket": "", - "RootFolder": "" + "RootFolder": "" }, "AppConfigurationSettings": { "BehindSSLProxy": false,