2

ServiceStack 的内部日志记录不是我想在我的日志中包含的东西。我们如何禁用内部日志记录,或者至少抑制它以免阻塞日志?

4

2 回答 2

4

配置 LogManager 时,只需将其设置为 NullLogFactory 的实例

LogManager.LogFactory = new NullLogFactory();
于 2013-09-04T08:09:54.337 回答
1

服务堆栈版本 5 >

SetConfig(new HostConfig {
            DefaultRedirectPath = "/metadata",
            DefaultContentType = MimeTypes.Json,
            AppendUtf8CharsetOnContentTypes = new HashSet<string> { MimeTypes.Html, MimeTypes.Json },
            DebugMode = false,
            LogFactory = new NullLogFactory(),
            EnableFeatures = Feature.All.Remove(disableFeatures)
)
于 2021-03-04T08:18:29.050 回答