From 835e6a57945bbe5392c8db2b3e78a8183a2d262d Mon Sep 17 00:00:00 2001 From: moberacker Date: Thu, 27 Jul 2017 16:47:45 +0200 Subject: [PATCH] Fix of unusable version 2.0.2 --- Log4ALA/Log4ALA.nuspec | 2 +- Log4ALA/Properties/AssemblyInfo.cs | 4 ++-- Log4ALA/QueueLogger.cs | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Log4ALA/Log4ALA.nuspec b/Log4ALA/Log4ALA.nuspec index e37a190..8eb0775 100644 --- a/Log4ALA/Log4ALA.nuspec +++ b/Log4ALA/Log4ALA.nuspec @@ -11,7 +11,7 @@ false Log4Net appender for Azure Log Analytics (ALA)... sending data to Azure Log Analytics with the HTTP Data Collector API. The data will also be logged/sent asynchronously for high performance and to avoid blocking the caller thread. Copyright © 2017 PTV Group - Add configurable priority (threadPriority) of the background worker thread and fixed issue to avoid high CPU usage. + Fix of unusable version 2.0.2. diff --git a/Log4ALA/Properties/AssemblyInfo.cs b/Log4ALA/Properties/AssemblyInfo.cs index 485e266..073841d 100644 --- a/Log4ALA/Properties/AssemblyInfo.cs +++ b/Log4ALA/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.2")] -[assembly: AssemblyFileVersion("2.0.2")] +[assembly: AssemblyVersion("2.0.3")] +[assembly: AssemblyFileVersion("2.0.3")] diff --git a/Log4ALA/QueueLogger.cs b/Log4ALA/QueueLogger.cs index c4b9281..eb11c18 100644 --- a/Log4ALA/QueueLogger.cs +++ b/Log4ALA/QueueLogger.cs @@ -104,15 +104,18 @@ protected virtual void Run() { try { - line = Queue.Take(); - if (!string.IsNullOrWhiteSpace(line)) + if (Queue.Count > 0) { - byteLength += System.Text.Encoding.Unicode.GetByteCount(line); - - buffer.Append(line); - buffer.Append(","); - ++numItems; - line = string.Empty; + line = Queue.Take(); + if (!string.IsNullOrWhiteSpace(line)) + { + byteLength += System.Text.Encoding.Unicode.GetByteCount(line); + + buffer.Append(line); + buffer.Append(","); + ++numItems; + line = string.Empty; + } } } catch (Exception ee)