1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-19 16:33:36 +03:00

Add file logging

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-08-02 15:17:23 +05:00
parent 940f2e64a0
commit 0cc5763cc4
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
2 changed files with 3 additions and 0 deletions

View file

@ -28,6 +28,7 @@
<PackageReference Include="Remora.Discord.Extensions" Version="5.3.2"/>
<PackageReference Include="Remora.Discord.Hosting" Version="6.0.7"/>
<PackageReference Include="Remora.Discord.Interactivity" Version="4.5.1"/>
<PackageReference Include="Serilog.Extensions.Logging.File" Version="3.0.0"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="locale\Messages.resx">

View file

@ -95,6 +95,8 @@ public class Boyfriend {
}
).ConfigureLogging(
c => c.AddConsole()
.AddFile("Logs/Boyfriend-{Date}.log",
outputTemplate: "{Timestamp:o} [{Level:u4}] {Message} {NewLine}{Exception}")
.AddFilter("System.Net.Http.HttpClient.*.LogicalHandler", LogLevel.Warning)
.AddFilter("System.Net.Http.HttpClient.*.ClientHandler", LogLevel.Warning)
);