diff --git a/TimberWinR.ExtractID/Program.cs b/TimberWinR.ExtractID/Program.cs index ab3ebfc..2f826a5 100644 --- a/TimberWinR.ExtractID/Program.cs +++ b/TimberWinR.ExtractID/Program.cs @@ -99,9 +99,7 @@ namespace TimberWinR.ExtractID Console.WriteLine("Updated {0} ProductID: {1}", args[2], productCode); return 0; - } - - Console.Error.WriteLine("Failed for some reason"); + } } } } diff --git a/TimberWinR.UnitTests/FakeRediServer.cs b/TimberWinR.UnitTests/FakeRediServer.cs index a69ce1f..7c53dca 100644 --- a/TimberWinR.UnitTests/FakeRediServer.cs +++ b/TimberWinR.UnitTests/FakeRediServer.cs @@ -21,9 +21,7 @@ namespace TimberWinR.UnitTests private Thread _listenThreadV6; private readonly int _port; private CancellationToken _cancelToken; - private bool _shutdown; - public event Action OnMessageRecieved; - + private bool _shutdown; public FakeRediServer(CancellationToken cancelToken, int port = 6379) { @@ -107,7 +105,7 @@ namespace TimberWinR.UnitTests // System.Diagnostics.Debug.WriteLine(String.Format("Sent: {0}", data)); } } - catch (IOException ioex) + catch (IOException) { } } while (true); diff --git a/TimberWinR.UnitTests/MultilineTests.cs b/TimberWinR.UnitTests/MultilineTests.cs index 9296fe4..27ccdf1 100644 --- a/TimberWinR.UnitTests/MultilineTests.cs +++ b/TimberWinR.UnitTests/MultilineTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; @@ -52,7 +51,7 @@ namespace TimberWinR.UnitTests if (!cancelTokenSource.Token.IsCancellationRequested) syncHandle.Wait(TimeSpan.FromSeconds(10000), cancelTokenSource.Token); } - catch (OperationCanceledException oex) + catch (OperationCanceledException) { } } @@ -102,7 +101,7 @@ namespace TimberWinR.UnitTests if (!cancelTokenSource.Token.IsCancellationRequested) syncHandle.Wait(TimeSpan.FromSeconds(10000), cancelTokenSource.Token); } - catch (OperationCanceledException oex) + catch (OperationCanceledException) { } } diff --git a/TimberWinR.UnitTests/TailFileTests.cs b/TimberWinR.UnitTests/TailFileTests.cs index 5cfc1cc..12a044e 100644 --- a/TimberWinR.UnitTests/TailFileTests.cs +++ b/TimberWinR.UnitTests/TailFileTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; @@ -61,7 +60,7 @@ namespace TimberWinR.UnitTests } } } - catch (OperationCanceledException oex) + catch (OperationCanceledException) { Console.WriteLine("Done!"); } diff --git a/TimberWinR/Configuration.cs b/TimberWinR/Configuration.cs index 7294f32..8b8d8eb 100644 --- a/TimberWinR/Configuration.cs +++ b/TimberWinR/Configuration.cs @@ -30,7 +30,7 @@ namespace TimberWinR public class Configuration { private CancellationToken _cancelToken; - private bool _stopService; + private FileSystemWatcher _dirWatcher; private Manager _manager; @@ -177,8 +177,7 @@ namespace TimberWinR } private void ShutdownDirectoryMonitor() - { - _stopService = true; + { _dirWatcher.EnableRaisingEvents = false; LogManager.GetCurrentClassLogger().Info("Stopping Directory Monitor"); } diff --git a/TimberWinR/Inputs/IISW3CInputListener.cs b/TimberWinR/Inputs/IISW3CInputListener.cs index a7ab436..5f64765 100644 --- a/TimberWinR/Inputs/IISW3CInputListener.cs +++ b/TimberWinR/Inputs/IISW3CInputListener.cs @@ -138,7 +138,7 @@ namespace TimberWinR.Inputs if (!Stop) syncHandle.Wait(TimeSpan.FromSeconds(_pollingIntervalInSeconds), CancelToken); } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } diff --git a/TimberWinR/Inputs/LogsListener.cs b/TimberWinR/Inputs/LogsListener.cs index d35ea43..ee12bec 100644 --- a/TimberWinR/Inputs/LogsListener.cs +++ b/TimberWinR/Inputs/LogsListener.cs @@ -328,7 +328,7 @@ namespace TimberWinR.Inputs _fnfmap[fn] = fn; } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } @@ -345,7 +345,7 @@ namespace TimberWinR.Inputs if (!Stop) syncHandle.Wait(TimeSpan.FromSeconds(_pollingIntervalInSeconds), CancelToken); } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { } catch (Exception ex1) diff --git a/TimberWinR/Inputs/TailFileListener.cs b/TimberWinR/Inputs/TailFileListener.cs index 874d191..d49b5a2 100644 --- a/TimberWinR/Inputs/TailFileListener.cs +++ b/TimberWinR/Inputs/TailFileListener.cs @@ -296,7 +296,7 @@ namespace TimberWinR.Inputs LogManager.GetCurrentClassLogger().Warn(fnfex.Message); _fnfmap[fn] = fn; } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } diff --git a/TimberWinR/Inputs/UdpInputListener.cs b/TimberWinR/Inputs/UdpInputListener.cs index 3ab6087..fcff71d 100644 --- a/TimberWinR/Inputs/UdpInputListener.cs +++ b/TimberWinR/Inputs/UdpInputListener.cs @@ -13,8 +13,8 @@ namespace TimberWinR.Inputs public class UdpInputListener : InputListener { private readonly System.Net.Sockets.UdpClient _udpListener; - private IPEndPoint groupV4; - private IPEndPoint groupV6; + private readonly IPEndPoint groupV4; + private readonly IPEndPoint groupV6; private Thread _listenThreadV4; private Thread _listenThreadV6; @@ -47,6 +47,9 @@ namespace TimberWinR.Inputs { _port = port; + groupV4 = new IPEndPoint(IPAddress.Any, 0); + groupV6 = new IPEndPoint(IPAddress.IPv6Any, 0); + LogManager.GetCurrentClassLogger().Info("Udp Input on Port {0} Ready", _port); _receivedMessages = 0; diff --git a/TimberWinR/Inputs/W3CInputListener.cs b/TimberWinR/Inputs/W3CInputListener.cs index 3e43f6a..7b15f56 100644 --- a/TimberWinR/Inputs/W3CInputListener.cs +++ b/TimberWinR/Inputs/W3CInputListener.cs @@ -153,7 +153,7 @@ namespace TimberWinR.Inputs if (!Stop) syncHandle.Wait(TimeSpan.FromSeconds(_pollingIntervalInSeconds), CancelToken); } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } diff --git a/TimberWinR/Inputs/WindowsEvtInputListener.cs b/TimberWinR/Inputs/WindowsEvtInputListener.cs index 31b584f..fed7c32 100644 --- a/TimberWinR/Inputs/WindowsEvtInputListener.cs +++ b/TimberWinR/Inputs/WindowsEvtInputListener.cs @@ -165,7 +165,7 @@ namespace TimberWinR.Inputs if (!Stop) syncHandle.Wait(TimeSpan.FromSeconds(_pollingIntervalInSeconds), CancelToken); } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } diff --git a/TimberWinR/Outputs/Elasticsearch.cs b/TimberWinR/Outputs/Elasticsearch.cs index ceaf446..468564e 100644 --- a/TimberWinR/Outputs/Elasticsearch.cs +++ b/TimberWinR/Outputs/Elasticsearch.cs @@ -169,7 +169,7 @@ namespace TimberWinR.Outputs syncHandle.Wait(TimeSpan.FromMilliseconds(_interval), CancelToken); } } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } diff --git a/TimberWinR/Outputs/Redis.cs b/TimberWinR/Outputs/Redis.cs index cbee023..2a536b3 100644 --- a/TimberWinR/Outputs/Redis.cs +++ b/TimberWinR/Outputs/Redis.cs @@ -130,8 +130,7 @@ namespace TimberWinR.Outputs private long _redisDepth; private DateTime? _lastErrorTimeUTC; private readonly int _maxQueueSize; - private readonly bool _queueOverflowDiscardOldest; - private bool _warnedReachedMax; + private readonly bool _queueOverflowDiscardOldest; private BatchCounter _batchCounter; public bool Stop { get; set; } @@ -201,8 +200,7 @@ namespace TimberWinR.Outputs public RedisOutput(TimberWinR.Manager manager, Parser.RedisOutput ro, CancellationToken cancelToken) : base(cancelToken, "Redis") - { - _warnedReachedMax = false; + { _redisDepth = 0; _batchCount = ro.BatchCount; _maxBatchCount = ro.MaxBatchCount; @@ -391,11 +389,11 @@ namespace TimberWinR.Outputs if (!Stop) syncHandle.Wait(TimeSpan.FromMilliseconds(_interval), CancelToken); } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } - catch(ThreadAbortException tex) + catch(ThreadAbortException) { break; } diff --git a/TimberWinR/Outputs/Stdout.cs b/TimberWinR/Outputs/Stdout.cs index 41347b3..410c09a 100644 --- a/TimberWinR/Outputs/Stdout.cs +++ b/TimberWinR/Outputs/Stdout.cs @@ -78,7 +78,7 @@ namespace TimberWinR.Outputs if (!Stop) syncHandle.Wait(TimeSpan.FromMilliseconds(_interval), CancelToken); } - catch (OperationCanceledException oce) + catch (OperationCanceledException) { break; } diff --git a/chocolateyUninstall.ps1.template b/chocolateyUninstall.ps1.template index 3e5d46a..7659c85 100644 --- a/chocolateyUninstall.ps1.template +++ b/chocolateyUninstall.ps1.template @@ -1,7 +1,7 @@ $packageName = 'TimberWinR-${version}' # arbitrary name for the package, used in messages $installerType = 'msi' #only one of these: exe, msi, msu $url = 'http://www.ericfontana.com/TimberWinR/TimberWinR-${version}.0.msi' # download url -$silentArgs = '{593EF0C4-54E0-40D5-A3E3-922CD1C25B9E} /quiet' +$silentArgs = '${PROJECTGUID} /quiet' $validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx UnInstall-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes