ServiceStack的内部日志记录不是我希望在日志中使用的内容。我们如何禁用内部日志记录,或至少抑制它以使其不会阻塞日志?
答案 0 :(得分:4)
配置LogManager时,只需将其设置为NullLogFactory
的实例LogManager.LogFactory = new NullLogFactory();
答案 1 :(得分:1)
ServiceStack Ver 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)
)