如何防止来自servicestack log4net的冗余日志?

How to prevent redundant log from servicestack log4net?

我正在使用 ASP.NET MVC,servicestack.logging 我使用的是 log4net。 我想通过以下代码记录当前用户机智:

private static readonly ILog Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

Logger.Info(session.UserAuthId.ToString());

并在 web.config

    <appender type="log4net.Appender.RollingFileAppender" name="User_Log">
  <file value="C:\logs" />
  <datePattern value="dd.MM.yyyy'.log'" />
  <appendToFile value="true" />
  <maxSizeRollBackups value="10" />
  <maximumFileSize value="10MB" />
  <staticLogFileName value="false" />

  <layout type="log4net.Layout.PatternLayout">
  </layout>
</appender>

但是我在我的文本文件中看到了冗余日志:

我怎样才能删除包含在我的 log.txt 中的以下消息?

Registering Reply service 'WorkshopService' with request 'my web api name'
Registering OneWay service 'UploadService' with request 'my web api name'
Registering OneWay service 'PostmanService' with request 'Postman'
Initializing Application my application name Services took 1177.0709ms. No errors detected.

有什么帮助吗?谢谢

这些日志消息是 only logged in DebugMode from the ServiceStack.Host.ServiceController type, to hide them don't enable the debug logger or filter logging messages from the specified type