_______________________________________
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: Tuesday, March 07, 2006 5:12 PM
To: Log4NET User
Subject: RE: Log4net with .net 2.0 for com+ servicedcomponent
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+ servicedcomponentThomas,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+ servicedcomponentI 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 problemsThe 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 directiveAgain, 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 codeAssemblyInfo.cs[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]EventSink.csusing log4netusing 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 luckLog4Net.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.
