I've just taken over a C# project that uses the log4net xmllayout for logging.
The problem is that each event in the log has 4 data values: machinename, hostname, username and app which are always the same but are repeated for each event leading to unnecessarily large log files.
How do I prevent these from being logged?
Config file:
<?xml version="1.0"?>
<configuration>
  <!--log4net setting-->
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <log4net>
    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file type="log4net.Util.PatternString" value="%env{LocalAppData}\\myApp\\myApp.log.xml" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="1" />
      <maximumFileSize value="3MB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.XmlLayoutSchemaLog4j">
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="RollingFileAppender" />
    </root>
  </log4net>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_myAppWCF" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:12372/conserv" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_myAppWCF" contract="myAppNOWServiceClient.myAppWCF"
        name="BasicHttpBinding_myAppWCF" />
    </client>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>