Added braces
This commit is contained in:
@@ -47,7 +47,9 @@ public class Graylog : IDisposable
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(Hostname));
|
||||
}
|
||||
|
||||
_Hostname = value;
|
||||
SetUdp();
|
||||
@@ -60,7 +62,9 @@ public class Graylog : IDisposable
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
throw new ArgumentException("Port must be zero or greater.");
|
||||
}
|
||||
|
||||
_Port = value;
|
||||
SetUdp();
|
||||
|
||||
@@ -95,7 +95,10 @@ public class Splunk : IDisposable
|
||||
|
||||
public async Task<HttpResponseMessage> SendAsync(SplunkPayload splunkPayload, bool disableSplunkSSL = false)
|
||||
{
|
||||
if (splunkPayload == null) return null;
|
||||
if (splunkPayload == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var eventObject = new
|
||||
{
|
||||
@@ -115,7 +118,10 @@ public class Splunk : IDisposable
|
||||
}
|
||||
|
||||
var eventJson = JsonHelper.ToJson(eventObject);
|
||||
if (!HasHecToken) CreateHttpClient();
|
||||
if (!HasHecToken)
|
||||
{
|
||||
CreateHttpClient();
|
||||
}
|
||||
|
||||
using var content = new StringContent(eventJson, Encoding.UTF8, "application/json");
|
||||
return await HttpClient.PostAsync("/services/collector/event", content);
|
||||
|
||||
@@ -47,9 +47,11 @@ public class Syslog : IDisposable
|
||||
get => _Hostname;
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
throw new ArgumentNullException(nameof(Hostname));
|
||||
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(Hostname));
|
||||
}
|
||||
|
||||
_Hostname = value;
|
||||
SetUdp();
|
||||
}
|
||||
@@ -60,9 +62,11 @@ public class Syslog : IDisposable
|
||||
get => _Port;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
throw new ArgumentException("Port must be zero or greater.");
|
||||
|
||||
if (value < 0)
|
||||
{
|
||||
throw new ArgumentException("Port must be zero or greater.");
|
||||
}
|
||||
|
||||
_Port = value;
|
||||
SetUdp();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,9 @@ namespace EonaCat.Logger.Servers.Tcp
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(Hostname));
|
||||
}
|
||||
|
||||
_Hostname = value;
|
||||
SetTcp();
|
||||
@@ -56,7 +58,9 @@ namespace EonaCat.Logger.Servers.Tcp
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
throw new ArgumentException("Port must be zero or greater.");
|
||||
}
|
||||
|
||||
_Port = value;
|
||||
SetTcp();
|
||||
|
||||
@@ -42,7 +42,9 @@ namespace EonaCat.Logger.Servers.Udp
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(Hostname));
|
||||
}
|
||||
|
||||
_Hostname = value;
|
||||
SetUdp();
|
||||
@@ -55,7 +57,9 @@ namespace EonaCat.Logger.Servers.Udp
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
throw new ArgumentException("Port must be zero or greater.");
|
||||
}
|
||||
|
||||
_Port = value;
|
||||
SetUdp();
|
||||
|
||||
Reference in New Issue
Block a user