feat(logging): route Worker logging through shared LoggingSetup
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\ClaudeDo.Data\ClaudeDo.Data.csproj" />
|
<ProjectReference Include="..\ClaudeDo.Data\ClaudeDo.Data.csproj" />
|
||||||
|
<ProjectReference Include="..\ClaudeDo.Logging\ClaudeDo.Logging.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -31,13 +31,8 @@ var builder = WebApplication.CreateBuilder(args);
|
|||||||
|
|
||||||
var logRoot = cfg.LogRoot;
|
var logRoot = cfg.LogRoot;
|
||||||
Directory.CreateDirectory(logRoot);
|
Directory.CreateDirectory(logRoot);
|
||||||
builder.Host.UseSerilog((ctx, lc) => lc
|
builder.Host.UseSerilog((ctx, lc) =>
|
||||||
.MinimumLevel.Information()
|
ClaudeDo.Logging.LoggingSetup.Configure(lc, "worker", logRoot));
|
||||||
.WriteTo.File(
|
|
||||||
System.IO.Path.Combine(logRoot, "worker-.log"),
|
|
||||||
rollingInterval: RollingInterval.Day,
|
|
||||||
retainedFileCountLimit: 7,
|
|
||||||
shared: true));
|
|
||||||
|
|
||||||
builder.Services.AddDbContextFactory<ClaudeDoDbContext>(opt =>
|
builder.Services.AddDbContextFactory<ClaudeDoDbContext>(opt =>
|
||||||
opt.UseSqlite($"Data Source={cfg.DbPath}"));
|
opt.UseSqlite($"Data Source={cfg.DbPath}"));
|
||||||
|
|||||||
Reference in New Issue
Block a user