Skip to content

Commit 05ca313

Browse files
committed
logger exception message instead of stack trace
1 parent 38632c1 commit 05ca313

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libs/common/Format.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static async Task<EndPoint[]> TryCreateEndpoint(string singleAddressOrHos
128128
}
129129
catch (Exception ex)
130130
{
131-
logger?.LogError(ex, "Error while trying to resolve hostname:{hostname}", singleAddressOrHostname);
131+
logger?.LogError("Error while trying to resolve hostname: {exMessage} [{hostname}]", ex.Message, singleAddressOrHostname);
132132
}
133133

134134
return null;

libs/host/Configuration/OptionsValidators.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ protected override ValidationResult IsValid(object value, ValidationContext vali
361361
return initValidationResult;
362362

363363
var logger = ((Options)validationContext.ObjectInstance).runtimeLogger;
364-
365-
if (!Format.TryParseAddressList(ipAddresses, 0, out var endpoints, out var errorHostnameOrAddress, useForBind: false, logger: logger))
364+
if (!Format.TryParseAddressList(ipAddresses, 0, out _, out var errorHostnameOrAddress, useForBind: false, logger: logger))
366365
{
367366
var baseError = validationContext.MemberName != null ? base.FormatErrorMessage(validationContext.MemberName) : string.Empty;
368367
var errorMessage = $"{baseError} Expected string in IPv4 / IPv6 format (e.g. 127.0.0.1 / 0:0:0:0:0:0:0:1) or 'localhost' or valid hostname. Actual value: {errorHostnameOrAddress}";

0 commit comments

Comments
 (0)