diff --git a/ConsoleApp1/Program.cs b/ConsoleApp1/Program.cs index d6bc593..fdd9bd6 100644 --- a/ConsoleApp1/Program.cs +++ b/ConsoleApp1/Program.cs @@ -12,6 +12,12 @@ var logger = new LogBuilder("MyApp") .BoostWithProcessId() .Build(); +while (true) +{ + logger.Information("Application started - iteration "); + logger.Error(new Exception("Nerd!"), "Something went wrong - iteration"); +} + Console.WriteLine("Logger created successfully"); Console.WriteLine("Writing log entries..."); diff --git a/EonaCat.LogStack/EonaCat.LogStack.csproj b/EonaCat.LogStack/EonaCat.LogStack.csproj index c2b34c2..7ccef21 100644 --- a/EonaCat.LogStack/EonaCat.LogStack.csproj +++ b/EonaCat.LogStack/EonaCat.LogStack.csproj @@ -14,7 +14,7 @@ It features a rich fluent API for routing log events to dozens of destinations f EonaCat (Jeroen Saey) EonaCat;Logger;EonaCatLogStack;Log;Writer;Flows;LogStack;Memory;Speed;Jeroen;Saey - 0.1.8 + 0.1.9 README.md True LICENSE @@ -25,7 +25,7 @@ It features a rich fluent API for routing log events to dozens of destinations f - 0.1.8+{chash:10}.{c:ymd} + 0.1.9+{chash:10}.{c:ymd} true true v[0-9]* @@ -36,7 +36,7 @@ It features a rich fluent API for routing log events to dozens of destinations f - 0.1.8 + 0.1.9 EonaCat.LogStack EonaCat.LogStack https://git.saey.me/EonaCat/EonaCat.LogStack diff --git a/EonaCat.LogStack/EonaCatLoggerCore/Flows/EncryptedFileFlow.cs b/EonaCat.LogStack/EonaCatLoggerCore/Flows/EncryptedFileFlow.cs index c6468b2..dc09ad7 100644 --- a/EonaCat.LogStack/EonaCatLoggerCore/Flows/EncryptedFileFlow.cs +++ b/EonaCat.LogStack/EonaCatLoggerCore/Flows/EncryptedFileFlow.cs @@ -181,8 +181,6 @@ namespace EonaCat.LogStack.Flows throw new ArgumentNullException("template"); } - CheckForProcessTermination(); - _directory = directory; _password = password; _filePrefix = filePrefix; @@ -263,33 +261,6 @@ namespace EonaCat.LogStack.Flows _retentionThread.Start(); } - private void CheckForProcessTermination() - { - AppDomain.CurrentDomain.ProcessExit += (_, __) => - { - try - { - DisposeAsync().AsTask().GetAwaiter().GetResult(); - } - catch - { - // Do nothing - } - }; - - Console.CancelKeyPress += (_, e) => - { - try - { - DisposeAsync().AsTask().GetAwaiter().GetResult(); - } - catch - { - // Do nothing - } - }; - } - /// Add an ambient property enricher applied to every event. public EncryptedFileFlow EnrichWith(string key, Func valueFactory) { diff --git a/EonaCat.LogStack/EonaCatLoggerCore/Flows/FileFlow.cs b/EonaCat.LogStack/EonaCatLoggerCore/Flows/FileFlow.cs index 23b1cda..19fa2c9 100644 --- a/EonaCat.LogStack/EonaCatLoggerCore/Flows/FileFlow.cs +++ b/EonaCat.LogStack/EonaCatLoggerCore/Flows/FileFlow.cs @@ -185,8 +185,6 @@ namespace EonaCat.LogStack.Flows throw new ArgumentNullException("template"); } - CheckForProcessTermination(); - _batchSize = batchSize <= 0 ? 1 : batchSize; _directory = directory; _filePrefix = filePrefix; @@ -247,33 +245,6 @@ namespace EonaCat.LogStack.Flows _retentionTask = Task.Factory.StartNew(RetentionLoop, TaskCreationOptions.LongRunning); } - private void CheckForProcessTermination() - { - AppDomain.CurrentDomain.ProcessExit += (_, __) => - { - try - { - DisposeAsync().AsTask().GetAwaiter().GetResult(); - } - catch - { - // Do nothing - } - }; - - Console.CancelKeyPress += (_, e) => - { - try - { - DisposeAsync().AsTask().GetAwaiter().GetResult(); - } - catch - { - // Do nothing - } - }; - } - /// Add an ambient property enricher applied to every event. public FileFlow EnrichWith(string key, Func valueFactory) {