I have a working c# exchange event sink (serviced component) that will do things like autoaccept, log message activities in a database and route messages.  I wanted to use log4net with this but am having problems
 
The core problem is that i am not getting any log messages (though i tried various configurations)
 
log4net compiled from source in .net using NET_2_0 compile directive
 
Again, my component is doing work - and i can use a FileStream to write to the ..\logs\CurrentLog directory - but not log4net - so, the component has write access...
 
I am now going to try the log4net internal debugging - but wondered if i had anything fundamentally wrong.  Below are my config and code
 
AssemblyInfo.cs
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]
 
EventSink.cs
    using log4net
    using log4net.Config
    ...
    private static readonly ILog log = LogManager.GetLogger(typeof(ExchEventSink));
    ...
    OnSave()
       log.Debug("Some debug message");
       // also tried adding various entries of  XmlConfigurator.Configure with no luck
 
Log4Net.config
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
  <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="..\\logs\\CurrentLog" />
    <appendToFile value="true" />
    <datePattern value="yyyyMMdd" />
    <rollingStyle value="Date" />
    <filter type="log4net.Filter.LevelRangeFilter">
        <acceptOnMatch value="true" />
        <levelMin value="DEBUG" />
        <levelMax value="FATAL" />
    </filter>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern  value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
    </layout>
  </appender>
  <root>
    <level value="DEBUG" />
    <appender-ref ref="RollingLogFileAppender" />
   </root>
  </log4net>
 
 
 
............................................................
Cord Thomas
Information Services and Technology (IST)
RAND
1776 Main Street
Santa Monica CA 90407
Phone: 310.393.0411 x6672
e-mail: [EMAIL PROTECTED]
 


This email message is for the sole use of the intended recipient(s) and may contain privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


Reply via email to