Michael
 
Thank you.  This is maybe the key piece i am missing - the 'root folder'.  I had assumed the root folder was the folder the EventSink DLL was in.  But you may be suggesting this is some root Exchange folder, or as i read elsewhere, it may be windows\system32 -
 
That said, i was mistaken about the root folder - but the account that is registered as the Authorization account in Component Services is a Domain Admin (i am trying this just to try to ellminate permissions as an issue) who should have full rights to all resources on the Exchange host.
 
Finally - when you suggest the 'repository name should be the same as the assembly, you are saying that if my assembly says this:
 
[assembly: AssemblyTitle("AnEventSink")]
 
that i need the log4net to say
 
[assembly: log4net.Config.Repository("AnEventSink")]
 
I am unclear what an assembly name is - it is the namespace of my EventSink (which also happens to be AnEventSink)?
Thank you
 
Cord
 


From: Michael Hinkel [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 07, 2006 1:19 AM
To: Log4NET User
Subject: RE: Log4net with .net 2.0 for com+ servicedcomponent

Thomas,
 
I've successfully set up log4net logging for a serviced component which is hosted inside the IIS (.NET remoting service) using .NET 1.1.
 
To do this, the application (e.g. IIS) has to have write access to the folder where the log file is to be created (this seems to be okay in your setting).
 
Next, I've added the following log4net declaration in one class (e.g. a base class of a class hierarchy) of each project which should use log4net:
 
[assembly: log4net.Config.Repository("Server")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile="Web.config")]
The repository name should be the name of the assembly - but if you use several projects and therefore have several assemblies you have to use the same repository name in each project (at least I needed to do this, because otherwise only one assembly was able to successfully use log4net, and the other silently failed).
 
You also have to find out the root folder of your component, which depends on the application that uses your component.
 
Hope this information is not completely wrong and might be of any help to you...
 
 
Michael

_______________________________________
DATATRAK Deutschland GmbH
Michael Hinkel
Software Developer
Rochusstrasse 65
53123 Bonn

Tel +49 (228) 97983-602
Fax +49 (228) 97983-34
[EMAIL PROTECTED]
http://www.datatrak.net
 

 


From: Thomas, Cord [mailto:[EMAIL PROTECTED]
Sent: Monday, March 06, 2006 10:36 PM
To: [email protected]
Subject: Log4net with .net 2.0 for com+ servicedcomponent

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.




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