Skip to content

Commit 94807e7

Browse files
committed
Remove file and console log sinks
1 parent e9138d8 commit 94807e7

File tree

3 files changed

+12
-36
lines changed

3 files changed

+12
-36
lines changed

src/Bible.Alarm/Bible.Alarm.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120" />
4343
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.120" />
4444
<PackageReference Include="Plugin.StoreReview" Version="6.2.0" />
45+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
46+
<PackageReference Include="Fluxor" Version="6.0.0" />
47+
<PackageReference Include="Polly" Version="8.5.0" />
48+
<PackageReference Include="Quartz" Version="3.13.1" />
49+
<PackageReference Include="Serilog" Version="4.2.0" />
50+
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
4551
</ItemGroup>
4652

4753
<ItemGroup>
@@ -83,17 +89,6 @@
8389
<PropertyGroup>
8490
<EnableDefaultXamlItems>false</EnableDefaultXamlItems>
8591
</PropertyGroup>
86-
<ItemGroup>
87-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
88-
<PackageReference Include="Fluxor" Version="6.0.0" />
89-
<PackageReference Include="Polly" Version="8.5.0" />
90-
<PackageReference Include="Quartz" Version="3.13.1" />
91-
<PackageReference Include="Serilog" Version="4.2.0" />
92-
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
93-
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
94-
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
95-
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
96-
</ItemGroup>
9792

9893
<!-- Enable platform-specific multi-targeting for files with platform extensions -->
9994
<ItemGroup>

src/Bible.Alarm/Common/LogSetup.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,15 @@ private static void SetupSerilog(IVersionFinder versionFinder, string[] tags)
4444
foreach (var tag in tags)
4545
loggerConfig.Enrich.WithProperty("Tag", tag);
4646

47-
// Configure debug sink for Visual Studio debug window
47+
// Configure debug sink for Visual Studio Output window
48+
// This writes to System.Diagnostics.Debug which appears in Visual Studio Output window
49+
// Works on Windows, Android, and iOS when debugging in Visual Studio
50+
// Make sure to select "Debug" in the Output window's "Show output from:" dropdown
4851
#if DEBUG
4952
loggerConfig.WriteTo.Debug(
5053
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}");
5154
#endif
5255

53-
// Configure console sink
54-
loggerConfig.WriteTo.Console(
55-
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}");
56-
57-
// Configure file sink for persistent logging
58-
loggerConfig.WriteTo.File(
59-
Path.Combine(FileSystem.Current.CacheDirectory, "logs", "bible-alarm-.log"),
60-
rollingInterval: RollingInterval.Day,
61-
retainedFileCountLimit: 7,
62-
outputTemplate:
63-
"[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}");
64-
6556
Log.Logger = loggerConfig.CreateLogger();
6657
}
6758

src/Bible.Alarm/Common/SerilogSetup.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,15 @@ private static void SetupSerilog(IVersionFinder versionFinder, string[] tags)
4444
foreach (var tag in tags)
4545
loggerConfig.Enrich.WithProperty("Tag", tag);
4646

47-
// Configure debug sink for Visual Studio debug window
47+
// Configure debug sink for Visual Studio Output window
4848
// This writes to System.Diagnostics.Debug which appears in Visual Studio Output window
49+
// Works on Windows, Android, and iOS when debugging in Visual Studio
4950
// Make sure to select "Debug" in the Output window's "Show output from:" dropdown
5051
#if DEBUG
5152
loggerConfig.WriteTo.Debug(
5253
outputTemplate: AppConstants.Logging.ConsoleOutputTemplate);
5354
#endif
5455

55-
// Configure console sink
56-
loggerConfig.WriteTo.Console(
57-
outputTemplate: AppConstants.Logging.ConsoleOutputTemplate);
58-
59-
// Configure file sink for persistent logging
60-
loggerConfig.WriteTo.File(
61-
Path.Combine(FileSystem.Current.CacheDirectory, AppConstants.FilePaths.LogsDirectoryName, AppConstants.FilePaths.LogFileNamePattern),
62-
rollingInterval: RollingInterval.Day,
63-
retainedFileCountLimit: AppConstants.CacheSettings.LogFileRetentionDays,
64-
outputTemplate: AppConstants.Logging.FileOutputTemplate);
65-
6656
Log.Logger = loggerConfig.CreateLogger();
6757
}
6858

0 commit comments

Comments
 (0)