logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kramer, Mat" <MKra...@datasci.com>
Subject Duplicate log entries with DLL/EXE combination
Date Thu, 26 Apr 2012 23:01:39 GMT
Hello,

 

We have a .NET executable and a DLL assembly that both use log4net.  One
of the complications is that the DLL is also called from an unmanaged
C++ application and we want logging to work in that setting.  Our
current solution works, but I get many duplicate log entries when I am
running the .NET EXE with the .NET DLL.  The configurations are below.
Any ideas for how to fix this?  I have to admit I don't really
understand how it works now.

 

Thanks!

 

Application configuration

 

<log4net>

 

  <appender name="DebugAppender"
type="log4net.Appender.RollingFileAppender">

    <file value="log-file-fauxnemah.txt" />

    <appendToFile value="true" />

    <rollingStyle value="Size" />

    <maxSizeRollBackups value="10" />

    <maximumFileSize value="50MB" />

    <staticLogFileName value="true" />

    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

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

      <conversionPattern value="%date %7level [%2thread]
%message%newline" />

    </layout>

  </appender>

 

  <root>

    <level value="ALL" />

    <appender-ref ref="DebugAppender" />

  </root>

 

</log4net>

 

DLL configuration

 

<log4net>

 

  <appender name="DebugAppender"
type="log4net.Appender.RollingFileAppender">

    <file value="TruSense//log-file-trusenseP3P.txt" />

    <appendToFile value="true" />

    <rollingStyle value="Size" />

    <maxSizeRollBackups value="10" />

    <maximumFileSize value="50MB" />

    <staticLogFileName value="true" />

    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

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

      <conversionPattern value="%date %7level [%2thread]
%message%newline" />

    </layout>

  </appender>

 

  <root>

    <level value="ALL" />

    <appender-ref ref="DebugAppender" />

  </root>

 

  <logger name="DSI.DACSS.Transformers.FahiTransformer"
additivity="false">

    <level value="NONE" />

  </logger>

 

  <logger name="DSI.DACSS.Framework.Logger.SystemLogger"
additivity="false">

    <level value="ALL" />

    <appender-ref ref="DebugAppender" />

  </logger>

 

</log4net>

 

 

-Mat

 


Mime
View raw message