diff --git a/src/NLog.Extensions.AzureBlobStorage/BlobStorageTarget.cs b/src/NLog.Extensions.AzureBlobStorage/BlobStorageTarget.cs index da79e9d..8ffea1a 100644 --- a/src/NLog.Extensions.AzureBlobStorage/BlobStorageTarget.cs +++ b/src/NLog.Extensions.AzureBlobStorage/BlobStorageTarget.cs @@ -130,8 +130,9 @@ public sealed class BlobStorageTarget : AsyncTaskTarget public Layout ProxyPassword { get; set; } /// - /// Uses the default credentials () for the proxy server, overriding any values that may have been set in and . + /// Uses the default credentials () for the proxy server. /// + /// Take precedence over and when set to . public bool UseDefaultCredentialsForProxy { get; set; } /// diff --git a/src/NLog.Extensions.AzureBlobStorage/README.md b/src/NLog.Extensions.AzureBlobStorage/README.md index 0751eea..1c401d1 100644 --- a/src/NLog.Extensions.AzureBlobStorage/README.md +++ b/src/NLog.Extensions.AzureBlobStorage/README.md @@ -69,7 +69,7 @@ _proxyLogin_ - Login to use for the proxy server. Requires `proxyPassword`. _proxyPassword_ - Password to use for the proxy server. Requires `proxyLogin`. -_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. +_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Take precedence over `proxyLogin` and `proxyPassword` when set to `true`. ### Batching Policy diff --git a/src/NLog.Extensions.AzureDataTables/DataTablesTarget.cs b/src/NLog.Extensions.AzureDataTables/DataTablesTarget.cs index 0ca1dee..ffc1d93 100644 --- a/src/NLog.Extensions.AzureDataTables/DataTablesTarget.cs +++ b/src/NLog.Extensions.AzureDataTables/DataTablesTarget.cs @@ -167,11 +167,11 @@ public override int GetHashCode() public Layout ProxyPassword { get; set; } /// - /// Uses the default credentials () for the proxy server, overriding any values that may have been set in and . + /// Uses the default credentials () for the proxy server. /// + /// Take precedence over and when set to . public bool UseDefaultCredentialsForProxy { get; set; } - /// /// Gets or sets the name of the Azure table where log entries will be stored. /// diff --git a/src/NLog.Extensions.AzureDataTables/README.md b/src/NLog.Extensions.AzureDataTables/README.md index 111c47b..ae3643c 100644 --- a/src/NLog.Extensions.AzureDataTables/README.md +++ b/src/NLog.Extensions.AzureDataTables/README.md @@ -68,7 +68,7 @@ _proxyLogin_ - Login to use for the proxy server. Requires `proxyPassword`. _proxyPassword_ - Password to use for the proxy server. Requires `proxyLogin`. -_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. +_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Take precedence over `proxyLogin` and `proxyPassword` when set to `true`. ### Dynamic TableEntity Instead of using the predefined NLogEntity-properties, then one can specify wanted properties: diff --git a/src/NLog.Extensions.AzureEventGrid/EventGridTarget.cs b/src/NLog.Extensions.AzureEventGrid/EventGridTarget.cs index 0f20b1a..1c94a27 100644 --- a/src/NLog.Extensions.AzureEventGrid/EventGridTarget.cs +++ b/src/NLog.Extensions.AzureEventGrid/EventGridTarget.cs @@ -152,8 +152,9 @@ public string DataFormat public Layout ProxyPassword { get; set; } /// - /// Uses the default credentials () for the proxy server, overriding any values that may have been set in and . + /// Uses the default credentials () for the proxy server. /// + /// Take precedence over and when set to . public bool UseDefaultCredentialsForProxy { get; set; } /// diff --git a/src/NLog.Extensions.AzureEventGrid/README.md b/src/NLog.Extensions.AzureEventGrid/README.md index bd5633e..6598ff4 100644 --- a/src/NLog.Extensions.AzureEventGrid/README.md +++ b/src/NLog.Extensions.AzureEventGrid/README.md @@ -74,7 +74,7 @@ _proxyLogin_ - Login to use for the proxy server. Requires `proxyPassword`. _proxyPassword_ - Password to use for the proxy server. Requires `proxyLogin`. -_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. +_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Take precedence over `proxyLogin` and `proxyPassword` when set to `true`. ### Retry Policy diff --git a/src/NLog.Extensions.AzureEventHub/EventHubTarget.cs b/src/NLog.Extensions.AzureEventHub/EventHubTarget.cs index 70837ab..9467d6e 100644 --- a/src/NLog.Extensions.AzureEventHub/EventHubTarget.cs +++ b/src/NLog.Extensions.AzureEventHub/EventHubTarget.cs @@ -201,9 +201,9 @@ public class EventHubTarget : AsyncTaskTarget public Layout ProxyPassword { get; set; } /// - /// Uses the default credentials () for the proxy server, overriding any values that may have been set in and . + /// Uses the default credentials () for the proxy server. /// - /// Only applies when = + /// Only applies when = . Take precedence over and when set to . public bool UseDefaultCredentialsForProxy { get; set; } /// @@ -261,7 +261,6 @@ protected override void InitializeTarget() string clientAuthSecret = string.Empty; string eventHubName = string.Empty; string useWebSockets = string.Empty; - string webSocketProxyAddress = string.Empty; string customEndPointAddress = string.Empty; string eventProducerIdentifier = string.Empty; @@ -287,7 +286,7 @@ protected override void InitializeTarget() eventProducerIdentifier = EventProducerIdentifier?.Render(defaultLogEvent) ?? string.Empty; useWebSockets = UseWebSockets?.Render(defaultLogEvent) ?? string.Empty; - if (!string.IsNullOrEmpty(useWebSockets) && (string.Equals(useWebSockets.Trim(), bool.TrueString, StringComparison.OrdinalIgnoreCase) || string.Equals(useWebSockets.Trim(), "1", StringComparison.OrdinalIgnoreCase))) + if (string.Equals(useWebSockets.Trim(), bool.TrueString, StringComparison.OrdinalIgnoreCase) || string.Equals(useWebSockets.Trim(), "1", StringComparison.OrdinalIgnoreCase)) { useWebSockets = bool.TrueString; } @@ -301,7 +300,6 @@ protected override void InitializeTarget() Login = ProxyLogin?.Render(defaultLogEvent), Password = ProxyPassword?.Render(defaultLogEvent) }; - proxySettings = proxySettings.RequiresManualProxyConfiguration ? proxySettings : null; _eventHubService.Connect(connectionString, eventHubName, serviceUri, tenantIdentity, managedIdentityResourceId, managedIdentityClientId, sharedAccessSignature, storageAccountName, storageAccountAccessKey, clientAuthId, clientAuthSecret, eventProducerIdentifier, bool.TrueString == useWebSockets, customEndPointAddress, proxySettings); InternalLogger.Debug("AzureEventHubTarget(Name={0}): Initialized", Name); @@ -615,7 +613,7 @@ public void Connect(string connectionString, string eventHubName, string service { options = new Azure.Messaging.EventHubs.Producer.EventHubProducerClientOptions(); options.ConnectionOptions.TransportType = useWebSockets ? EventHubsTransportType.AmqpWebSockets : options.ConnectionOptions.TransportType; - if (useWebSockets && proxySettings != null) + if (useWebSockets && proxySettings?.RequiresManualProxyConfiguration == true) options.ConnectionOptions.Proxy = proxySettings.CreateWebProxy(options.ConnectionOptions.Proxy); if (!string.IsNullOrEmpty(endPointAddress)) options.ConnectionOptions.CustomEndpointAddress = new Uri(endPointAddress); diff --git a/src/NLog.Extensions.AzureEventHub/README.md b/src/NLog.Extensions.AzureEventHub/README.md index 8455bda..1abecde 100644 --- a/src/NLog.Extensions.AzureEventHub/README.md +++ b/src/NLog.Extensions.AzureEventHub/README.md @@ -88,7 +88,7 @@ _proxyLogin_ - Login to use for the proxy server. Requires `proxyPassword`. Requ _proxyPassword_ - Password to use for the proxy server. Requires `proxyLogin`. Requires `useWebSockets = true`. -_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Requires `useWebSockets = true`. +_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Take precedence over `proxyLogin` and `proxyPassword` when set to `true`. Requires `useWebSockets = true`. ### Batching Policy diff --git a/src/NLog.Extensions.AzureQueueStorage/QueueStorageTarget.cs b/src/NLog.Extensions.AzureQueueStorage/QueueStorageTarget.cs index b032da7..f4d33d8 100644 --- a/src/NLog.Extensions.AzureQueueStorage/QueueStorageTarget.cs +++ b/src/NLog.Extensions.AzureQueueStorage/QueueStorageTarget.cs @@ -126,8 +126,9 @@ public sealed class QueueStorageTarget : AsyncTaskTarget public Layout ProxyPassword { get; set; } /// - /// Uses the default credentials () for the proxy server, overriding any values that may have been set in and . + /// Uses the default credentials () for the proxy server. /// + /// Take precedence over and when set to . public bool UseDefaultCredentialsForProxy { get; set; } /// diff --git a/src/NLog.Extensions.AzureQueueStorage/README.md b/src/NLog.Extensions.AzureQueueStorage/README.md index 0680720..859bfb4 100644 --- a/src/NLog.Extensions.AzureQueueStorage/README.md +++ b/src/NLog.Extensions.AzureQueueStorage/README.md @@ -67,7 +67,7 @@ _proxyLogin_ - Login to use for the proxy server. Requires `proxyPassword`. _proxyPassword_ - Password to use for the proxy server. Requires `proxyLogin`. -_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. +_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Take precedence over `proxyLogin` and `proxyPassword` when set to `true`. ### Batching Policy diff --git a/src/NLog.Extensions.AzureServiceBus/README.md b/src/NLog.Extensions.AzureServiceBus/README.md index 0c21eb2..4224b34 100644 --- a/src/NLog.Extensions.AzureServiceBus/README.md +++ b/src/NLog.Extensions.AzureServiceBus/README.md @@ -101,7 +101,7 @@ _proxyLogin_ - Login to use for the proxy server. Requires `proxyPassword`. Requ _proxyPassword_ - Password to use for the proxy server. Requires `proxyLogin`. Requires `useWebSockets = true`. -_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Requires `useWebSockets = true`. +_useDefaultCredentialsForProxy_ - Uses the default credentials (`System.Net.CredentialCache.DefaultCredentials`) for the proxy server. Take precedence over `proxyLogin` and `proxyPassword` when set to `true`. Requires `useWebSockets = true`. ### Batching Policy diff --git a/src/NLog.Extensions.AzureServiceBus/ServiceBusTarget.cs b/src/NLog.Extensions.AzureServiceBus/ServiceBusTarget.cs index 8d4380b..24be065 100644 --- a/src/NLog.Extensions.AzureServiceBus/ServiceBusTarget.cs +++ b/src/NLog.Extensions.AzureServiceBus/ServiceBusTarget.cs @@ -222,9 +222,9 @@ public sealed class ServiceBusTarget : AsyncTaskTarget public Layout ProxyPassword { get; set; } /// - /// Uses the default credentials () for the proxy server, overriding any values that may have been set in and . + /// Uses the default credentials () for the proxy server. /// - /// Only applies when = + /// Only applies when = . Take precedence over and when set to . public bool UseDefaultCredentialsForProxy { get; set; } /// @@ -280,7 +280,6 @@ protected override void InitializeTarget() string clientAuthSecret = string.Empty; string queueOrTopicName = string.Empty; string useWebSockets = string.Empty; - string webSocketProxyAddress = string.Empty; string customEndPointAddress = string.Empty; string eventProducerIdentifier = string.Empty; @@ -319,7 +318,7 @@ protected override void InitializeTarget() } useWebSockets = UseWebSockets?.Render(defaultLogEvent) ?? string.Empty; - if (!string.IsNullOrEmpty(useWebSockets) && (string.Equals(useWebSockets.Trim(), bool.TrueString, StringComparison.OrdinalIgnoreCase) || string.Equals(useWebSockets.Trim(), "1", StringComparison.OrdinalIgnoreCase))) + if (string.Equals(useWebSockets.Trim(), bool.TrueString, StringComparison.OrdinalIgnoreCase) || string.Equals(useWebSockets.Trim(), "1", StringComparison.OrdinalIgnoreCase)) { useWebSockets = bool.TrueString; } @@ -333,7 +332,6 @@ protected override void InitializeTarget() Login = ProxyLogin?.Render(defaultLogEvent), Password = ProxyPassword?.Render(defaultLogEvent) }; - proxySettings = proxySettings.RequiresManualProxyConfiguration ? proxySettings : null; _cloudServiceBus.Connect(connectionString, queueOrTopicName, serviceUri, tenantIdentity, managedIdentityResourceId, managedIdentityClientId, sharedAccessSignature, storageAccountName, storageAccountAccessKey, clientAuthId, clientAuthSecret, eventProducerIdentifier, bool.TrueString == useWebSockets, customEndPointAddress, timeToLive, proxySettings); InternalLogger.Debug("AzureServiceBusTarget(Name={0}): Initialized", Name); @@ -698,7 +696,7 @@ public void Connect(string connectionString, string queueOrTopicName, string ser { options = new Azure.Messaging.ServiceBus.ServiceBusClientOptions(); options.TransportType = useWebSockets ? ServiceBusTransportType.AmqpWebSockets : options.TransportType; - if (useWebSockets && proxySettings != null) + if (useWebSockets && proxySettings?.RequiresManualProxyConfiguration == true) options.WebProxy = proxySettings.CreateWebProxy(options.WebProxy); if (!string.IsNullOrEmpty(endPointAddress)) options.CustomEndpointAddress = new Uri(endPointAddress);