Skip to content

Commit 0a17124

Browse files
authored
fix: disable logging by default (#360)
1 parent 6c9c768 commit 0a17124

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/Cnblogs.Architecture.Ddd.Cqrs.ServiceAgent/InjectExtensions.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ public static IHttpClientBuilder AddServiceAgent<TClient, TImplementation>(
7171

7272
private static void AddLogging(this IHttpClientBuilder h, Action<LoggingOptions>? configure = null)
7373
{
74-
h.AddExtendedHttpClientLogging(o =>
74+
if (configure == null)
7575
{
76-
o.LogBody = false;
77-
o.LogRequestStart = false;
78-
o.BodySizeLimit = 2000;
79-
configure?.Invoke(o);
80-
});
76+
return;
77+
}
78+
79+
h.AddExtendedHttpClientLogging(configure.Invoke);
8180
}
8281

8382
private static void AddCqrsAcceptHeaders(this HttpClient h)

0 commit comments

Comments
 (0)