Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/NLog.Extensions.AzureBlobStorage/BlobStorageTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public sealed class BlobStorageTarget : AsyncTaskTarget
public Layout ProxyPassword { get; set; }

/// <summary>
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server, overriding any values that may have been set in <see cref="ProxyLogin"/> and <see cref="ProxyPassword"/>.
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server.
/// </summary>
/// <remarks>Take precedence over <see cref = "ProxyLogin" /> and <see cref="ProxyPassword"/> when set to <see langword="true"/>.</remarks>
public bool UseDefaultCredentialsForProxy { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Extensions.AzureBlobStorage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/NLog.Extensions.AzureDataTables/DataTablesTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ public override int GetHashCode()
public Layout ProxyPassword { get; set; }

/// <summary>
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server, overriding any values that may have been set in <see cref="ProxyLogin"/> and <see cref="ProxyPassword"/>.
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server.
/// </summary>
/// <remarks>Take precedence over <see cref = "ProxyLogin" /> and <see cref="ProxyPassword"/> when set to <see langword="true"/>.</remarks>
public bool UseDefaultCredentialsForProxy { get; set; }


/// <summary>
/// Gets or sets the name of the Azure table where log entries will be stored.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Extensions.AzureDataTables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/NLog.Extensions.AzureEventGrid/EventGridTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ public string DataFormat
public Layout ProxyPassword { get; set; }

/// <summary>
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server, overriding any values that may have been set in <see cref="ProxyLogin"/> and <see cref="ProxyPassword"/>.
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server.
/// </summary>
/// <remarks>Take precedence over <see cref = "ProxyLogin" /> and <see cref="ProxyPassword"/> when set to <see langword="true"/>.</remarks>
public bool UseDefaultCredentialsForProxy { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Extensions.AzureEventGrid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions src/NLog.Extensions.AzureEventHub/EventHubTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ public class EventHubTarget : AsyncTaskTarget
public Layout ProxyPassword { get; set; }

/// <summary>
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server, overriding any values that may have been set in <see cref="ProxyLogin"/> and <see cref="ProxyPassword"/>.
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server.
/// </summary>
/// <remarks>Only applies when <see cref="UseWebSockets"/> = <see langword="true"/></remarks>
/// <remarks>Only applies when <see cref="UseWebSockets"/> = <see langword="true"/>. Take precedence over <see cref = "ProxyLogin" /> and <see cref="ProxyPassword"/> when set to <see langword="true"/>.</remarks>
public bool UseDefaultCredentialsForProxy { get; set; }

/// <summary>
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Extensions.AzureEventHub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/NLog.Extensions.AzureQueueStorage/QueueStorageTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ public sealed class QueueStorageTarget : AsyncTaskTarget
public Layout ProxyPassword { get; set; }

/// <summary>
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server, overriding any values that may have been set in <see cref="ProxyLogin"/> and <see cref="ProxyPassword"/>.
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server.
/// </summary>
/// <remarks>Take precedence over <see cref = "ProxyLogin" /> and <see cref="ProxyPassword"/> when set to <see langword="true"/>.</remarks>
public bool UseDefaultCredentialsForProxy { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Extensions.AzureQueueStorage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Extensions.AzureServiceBus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions src/NLog.Extensions.AzureServiceBus/ServiceBusTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ public sealed class ServiceBusTarget : AsyncTaskTarget
public Layout ProxyPassword { get; set; }

/// <summary>
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server, overriding any values that may have been set in <see cref="ProxyLogin"/> and <see cref="ProxyPassword"/>.
/// Uses the default credentials (<see cref="System.Net.CredentialCache.DefaultCredentials"/>) for the proxy server.
/// </summary>
/// <remarks>Only applies when <see cref="UseWebSockets"/> = <see langword="true"/></remarks>
/// <remarks>Only applies when <see cref="UseWebSockets"/> = <see langword="true"/>. Take precedence over <see cref = "ProxyLogin" /> and <see cref="ProxyPassword"/> when set to <see langword="true"/>.</remarks>
public bool UseDefaultCredentialsForProxy { get; set; }

/// <summary>
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down