fix(server): Windows startup test asks for PostgreSQL; TITANO_LOG_LEVEL
The connection-string test built options with the platform default, which is SQLite on Windows, so it parsed a file path as a PostgreSQL connection string. The server gains a log level setting (TITANO_LOG_LEVEL, also in compose and the Unraid template); the test servers log warnings only, which cuts the suite's output from 511 to 80 lines so failures stay findable in CI logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
7 files changed
+22
-4
No files matched your search
@@ -36,16 +36,17 @@ public static class ServerHost
|
||||
|
||||
var builder = WebApplication.CreateSlimBuilder(new WebApplicationOptions { Args = args, ContentRootPath = AppContext.BaseDirectory });
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Logging.SetMinimumLevel(options.LogLevel);
|
||||
builder.Logging.AddSimpleConsole(c => c.SingleLine = true);
|
||||
builder.Logging.AddProvider(new FileLoggerProvider(new FileLogSink(options.LogPath, "server")));
|
||||
builder.Logging.AddFilter("Microsoft.AspNetCore", Microsoft.Extensions.Logging.LogLevel.Warning);
|
||||
builder.Logging.AddFilter("Microsoft.Hosting.Lifetime", Microsoft.Extensions.Logging.LogLevel.Information);
|
||||
builder.Logging.AddFilter("Microsoft.Hosting.Lifetime", options.LogLevel > Microsoft.Extensions.Logging.LogLevel.Information ? options.LogLevel : Microsoft.Extensions.Logging.LogLevel.Information);
|
||||
|
||||
// The archive module registers first, so a missing piece stops the server before it touches the database.
|
||||
configureServices?.Invoke(builder.Services);
|
||||
RequireArchiveModule(builder.Services);
|
||||
|
||||
using var bootLoggerFactory = LoggerFactory.Create(l => l.AddSimpleConsole(c => c.SingleLine = true));
|
||||
using var bootLoggerFactory = LoggerFactory.Create(l => l.AddSimpleConsole(c => c.SingleLine = true).SetMinimumLevel(options.LogLevel));
|
||||
var bootLogger = bootLoggerFactory.CreateLogger("Titano.Server");
|
||||
var certificate = CertificateStore.Load(options, bootLogger);
|
||||
var database = ServerDatabase.OpenAsync(options, bootLogger, CancellationToken.None).GetAwaiter().GetResult();
|
||||
|
||||
Reference in new issue
Block a user