I have been using 1.2.0 Beta8 version ( or version 1:2:0:30714 ). I tried running that system.diagnostics which produced the following log, which didn't really help using the config file detailed in previous email.
log4net: log4net assembly [log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=8887c5ebc944b89e]. Loaded from [Global Assembly Cache]. (.NET Runtime [1.1.4322.2032] on Microsoft Windows NT 5.1.2600.0) log4net: DefaultRepositorySelector: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: Creating repository for assembly [Opal.Logging, Version=2.0.2.0, Culture=neutral, PublicKeyToken=1701101df9f38588] log4net: DefaultRepositorySelector: Assembly [Opal.Logging, Version=2.0.2.0, Culture=neutral, PublicKeyToken=1701101df9f38588] Loaded From [Global Assembly Cache] log4net: DefaultRepositorySelector: Assembly [Opal.Logging, Version=2.0.2.0, Culture=neutral, PublicKeyToken=1701101df9f38588] does not have a DomainAttribute specified. log4net: DefaultRepositorySelector: Assembly [Opal.Logging, Version=2.0.2.0, Culture=neutral, PublicKeyToken=1701101df9f38588] using domain [log4net-default-domain] and repository type [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: Creating repository for domain [log4net-default-domain] using type [log4net.Repository.Hierarchy.Hierarchy] log4net: DOMConfigurator: configuring repository [log4net-default-domain] using file [C:/NGS/NGSPublicMobilePrePayProvisioningService/WebServiceProjects/MobilePr ePayProvisioning/web.config] log4net: DOMConfigurator: configuring repository [log4net-default-domain] using stream log4net: DOMConfigurator: loading XML configuration log4net: DOMConfigurator: Configuring Repository [log4net-default-domain] log4net: DOMConfigurator: Configuration update mode [Merge]. log4net: DOMConfigurator: Logger [root] Level string is [INFO]. log4net: DOMConfigurator: Logger [root] level set to [name="INFO",value=40000]. log4net: DOMConfigurator: Loading Appender [OpalLoggingAppender] type: [log4net.Appender.OpalLoggingAppender] log4net: DOMConfigurator: Setting Property [Threshold] to Level value [FATAL] log4net: DOMConfigurator: Created Appender [OpalLoggingAppender] log4net: DOMConfigurator: Adding appender named [OpalLoggingAppender] to logger [root]. log4net: DOMConfigurator: Loading Appender [RollingFileAppender] type: [log4net.Appender.RollingFileAppender] log4net: DOMConfigurator: Setting Property [File] to String value [C:\logs\NGSPublicMobilePrePayProvisioningService\NGSPublicMobilePrePayLog] log4net: DOMConfigurator: Setting Property [AppendToFile] to Boolean value [True] log4net: DOMConfigurator: Setting Property [RollingStyle] to RollingMode value [Date] log4net: DOMConfigurator: Setting Property [DatePattern] to String value [yyyyMMdd] log4net: DOMConfigurator: Setting Property [StaticLogFileName] to Boolean value [False] log4net: DOMConfigurator: Setting Property [ConversionPattern] to String value [%d - %m%n] log4net: DOMConfigurator: Setting Property [Layout] to object [log4net.Layout.PatternLayout] log4net: RollingFileAppender: Type = [0], r0 = [19700101], r1 = [19700101] log4net: RollingFileAppender: Type = [1], r0 = [19700101], r1 = [19700101] log4net: RollingFileAppender: Type = [2], r0 = [19700101], r1 = [19700101] log4net: RollingFileAppender: Type = [3], r0 = [19700101], r1 = [19700102] log4net: RollingFileAppender: Searching for existing files in [C:\logs\NGSPublicMobilePrePayProvisioningService] log4net: RollingFileAppender: curSizeRollBackups starts at [0] log4net: FileAppender: Opening file for writing [C:\logs\NGSPublicMobilePrePayProvisioningService\NGSPublicMobilePrePayLog20 051212] append [True] log4net: DOMConfigurator: Created Appender [RollingFileAppender] log4net: DOMConfigurator: Adding appender named [RollingFileAppender] to logger [root]. log4net: DOMConfigurator: Hierarchy Threshold [] The main reason for using the RollingFileAppender was that our webservices generate log files of 20MB a day, and it was just cleaner to use RollingFileAppender as it would generate a new file everyday. Do you what kind of errors have caused by the RollingFileAppender? If things have been fixed for next release then maybe switching to log4net 1.2.9 maybe better. Fahad -----Original Message----- From: Ron Grabowski [mailto:[EMAIL PROTECTED] Sent: 12 December 2005 22:28 To: Log4NET User Subject: RE: RollingFileAppender Stops logging in Web Service Try creating an additional FileAppender that does everything your RollingFileAppender does: <root> <level value="INFO" /> <appender-ref ref="OpalLoggingAppender" /> <appender-ref ref="RollingFileAppender" /> <appender-ref ref="FileAppender" /> </root> There may be a problem with how the RollingFileAppender is rolling its files. Adding a system.diagnostics node to your web.config will allow you to capture log4net's debug information: <appSettings> ... </appSettings> <system.diagnostics> <trace autoflush="true"> <listeners> <add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\\Inetpub\\wwwroot\\log4net.txt" /> </listeners> </trace> </system.diagnostics> What version of log4net are you using? DOMConfigurator has been depreciated as of 1.2.9 beta. --- Fahad Sarwar <[EMAIL PROTECTED]> wrote: > Thanks for yr reply. > > The SetConfigurator method is used to tell Log4Net where to find the > config file. The code is as follows: > > public static void SetConfigurator(string configFile) { > log4net.Config.DOMConfigurator.Configure( new System.IO.FileInfo( > configFile ) ); } > > It uses DOMConfigurator to specify the path to the config file. This > is called whenever an application starts (otherwise I have found > log4net to not log at all), for example in a WebService I have it > referenced in the Application_Start method, in a Windows Service I > have it when the Service is started, in a Windows Form I have it in > the beginning of the Main() method etc. > > Btw I havent referenced log4net.LogManager.Shutdown(); in any of my > code. > > thanks > Fahad > > -----Original Message----- > From: Ron Grabowski [mailto:[EMAIL PROTECTED] > Sent: 12 December 2005 16:11 > To: Log4NET User > Subject: Re: RollingFileAppender Stops logging in Web Service > > Perhaps there is something wrong in your > Opal.Logging.LogEntry.SetConfigurator method. Can we see the source to > that? > My Application_End usually includes a simple message to help my keep > track of when the app domain gets unloaded. > > protected void Application_End(Object sender, EventArgs e) { > log.Info("Application ended"); > log4net.LogManager.Shutdown(); > } > > Maybe something isn't automatically be re-initialized when the app > domain gets reloaded... > > --- Fahad Sarwar <[EMAIL PROTECTED]> wrote: > > > Hi, I am using Log4Net within a WebService. I have been > successfully > > logging to a file using the RollingFileAppender, however recently > the > > webservice stops logging completly to the file for no apparant > reason. > > The WebService continues to work successfully but no logs are > > generated. > > I have > > read in other threads that by touching the web.config file, this > will > > cause the webservice to start logging again. This works fine, but > > again, sometimes a week later or a month later, the WebService > stops > > logging. > > > > Has anyone come across this problem in the past as i have not seen > > anything on the forum. > > > > Below is a sample of the web.config used. > > > > <?xml version="1.0" encoding="utf-8" ?> <configuration> > > <configSections> > > <section name="log4net" > > type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" > /> > > </configSections> <appSettings> .... > > </appSettings> > > > > > > <log4net> > > <appender name="RollingFileAppender" > > type="log4net.Appender.RollingFileAppender"> > > <param name="File" > > > value="C:\\logs\\NGSPublicMobilePrePayProvisioningService\\NGSPublicMobilePr > > ePayLog" /> > > <param name="AppendToFile" value="true" /> > > <param name="RollingStyle" value="Date" /> > > <!--<param name="MaxSizeRollBackups" value="10" />--> > > <param name="DatePattern" value="yyyyMMdd" /> > > <param name="StaticLogFileName" value="false" /> > > <layout type="log4net.Layout.PatternLayout"> > > <param name="ConversionPattern" value="%d - %m%n" /> > > </layout> > > </appender> > > > > > > <appender name="OpalLoggingAppender" > > type="log4net.Appender.OpalLoggingAppender" > > > <param name="threshold" value="FATAL" /> > > </appender> > > > > <root> > > <level value="INFO" /> > > <appender-ref ref="OpalLoggingAppender" /> > > <appender-ref ref="RollingFileAppender" /> > > </root> > > </log4net> > > > > </configuration> > > > > Within my Global.asax file i use the following line of code, which > > basically tells the log4net where to find the web.config: > > > > protected void Application_Start(Object sender, EventArgs e) > > > > { > > > Opal.Logging.LogEntry.SetConfigurator(AppDomain.CurrentDomain.SetupInformati > > on.ConfigurationFile); } > > > > > > > > > > Fahad Sarwar > > > > Opal Telecom > > > > Applications Team > > > > Irlam > > > > Tel: +44 161 222 2145 > > > > Fax: +44 161 222 2008 > > > > Email: [EMAIL PROTECTED] > > > > > > > > This communication together with any attachments transmitted with > it > > ("this > > E-Mail") is intended only for the use of the addressee and may > > contain information which is privileged and confidential. If the > > reader of this E-Mail is not the intended recipient or the employee > > or agent responsible for delivering it to the intended recipient you > > are hereby notified that any use, dissemination, forwarding, > > printing or copying of this E-Mail > is > > strictly prohibited. Addressees should check this E-mail for > viruses. > > The > > Company makes no representations as regards the absence of viruses > in > > this > > E-Mail. If you have received this E-Mail in error please notify our > > IT Support Team immediately by telephone on 0845 456 9100 or via > e-mail > > at > > [EMAIL PROTECTED] Please then immediately delete, erase or > > otherwise destroy this E-Mail and any copies of it. > > > > Any opinions expressed in this E-Mail are those of the author and > do > > not > > necessarily constitute the views of the Company. Nothing in this > > E-Mail shall bind the Company in any contract or obligation. > > > > For the purposes of this E-Mail "the Company" means Opal Telecom > Ltd. > > Please feel free to visit our website: > > <http://www.opaltelecom.co.uk/> > > www.opaltelecom.co.uk > > > > Opal Telecom Ltd (Registered in England & Wales No. 3849133) > > > > Brinell Drive, Northbank Industrial Park, Irlam, Manchester M44 > 5BL. > > > > A member of the Carphone Warehouse Group of Companies > > > > > > > >
