feat: update docker-compose.yml for selfhost

This commit is contained in:
alyssa 2025-04-13 22:05:14 +00:00
parent 437ea72ed4
commit 292c182eb2
9 changed files with 68 additions and 84 deletions

View file

@ -19,5 +19,4 @@ public class CoreConfig
public LogEventLevel ConsoleLogLevel { get; set; } = LogEventLevel.Debug;
public LogEventLevel ElasticLogLevel { get; set; } = LogEventLevel.Information;
public LogEventLevel FileLogLevel { get; set; } = LogEventLevel.Information;
}

View file

@ -73,30 +73,6 @@ public class LoggingModule: Module
.Destructure.AsScalar<SwitchId>()
.Destructure.ByTransforming<ProxyTag>(t => new { t.Prefix, t.Suffix })
.Destructure.With<PatchObjectDestructuring>()
.WriteTo.Async(a =>
{
// Both the same output, except one is raw compact JSON and one is plain text.
// Output simultaneously. May remove the JSON formatter later, keeping it just in cast.
// Flush interval is 50ms (down from 10s) to make "tail -f" easier. May be too low?
a.File(
(config.LogDir ?? "logs") + $"/pluralkit.{_component}.log",
outputTemplate: outputTemplate,
retainedFileCountLimit: 10,
rollingInterval: RollingInterval.Day,
fileSizeLimitBytes: null,
flushToDiskInterval: TimeSpan.FromMilliseconds(50),
restrictedToMinimumLevel: config.FileLogLevel,
formatProvider: new UTCTimestampFormatProvider(),
buffered: true);
a.File(
new RenderedCompactJsonFormatter(new ScalarFormatting.JsonValue()),
(config.LogDir ?? "logs") + $"/pluralkit.{_component}.json",
rollingInterval: RollingInterval.Day,
flushToDiskInterval: TimeSpan.FromMilliseconds(50),
restrictedToMinimumLevel: config.FileLogLevel,
buffered: true);
})
.WriteTo.Async(a =>
a.Console(
theme: AnsiConsoleTheme.Code,