Yeah that makes sense. We have to call the following line of code in Application_Start to initialize Log4Net:
XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)) Amit Abe Gillespie <[EMAIL PROTECTED]> 05/28/2008 10:59 AM To Amit X Goswami/HBUS/[EMAIL PROTECTED] cc mono-list <[email protected]>, [EMAIL PROTECTED] Subject Re: [Mono-list] Mono Success Story Oh, yes, I definitely did this. Maybe it has to do with the fact that the root of the site is unpredictable and therefore when the XmlConfigurator.Configure() method is called it doesn't find the Web.config file. -Abe On May 28, 2008, at May/28/08 10:53 AM, [EMAIL PROTECTED] wrote: Abe, We're using log4Net configured in the Web.config file without any problems. You just have to register the section at the top of the file. Here's the structure of our file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <!-- Register a section handler for the log4net section --> <configSections> <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/> </configSections> <appSettings> ... </appSettings> <system.web> ... </system.web> <system.runtime.remoting> ... </system.runtime.remoting> <!-- This section contains the log4net configuration settings --> <log4net> ... </log4net> </configuration> Amit Abe Gillespie <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 05/28/2008 10:26 AM To mono-list <[email protected]> cc Subject [Mono-list] Mono Success Story I just wanted to write Miguel et. al and thank everyone for the amazing product that is Mono! My company, Obtuse Software, recently rolled out their online store which is 100% powered by Mono (you can see the Mono badge proudly displayed at the bottom of every page). Some key points about the site and its Mono utilization: o PostgreSQL database backend connected by Npgsql. o Webforms authentication with various Web.config <location>s. o Logging via log4net. o Google Checkout integration using the Google Checkout .Net API. o The purchased software is built on-the-fly by kicking off an external NAnt build process. NAnt builds both a license assembly and the NSIS Windows installer. The whole system is all Linux (CentOS) / all awesomeness. This is my first production use of Mono and it has been a great joy. Mono's ASP.NET has been greatly improved since my last failing attempt at a Mono site (somewhere back around Mono 1.1.x). Mono sensing updates to assemblies, .aspx files, and the Web.config is a big help. Now, of course, the entire experience wasn't w/o problems: o log4net's config doesn't work when embedded into the Web.config file. I had to use a separate config file and use log4net's XmlConfigurator.Configure(FileInfo pathToConfig) o It's difficult to predict the root directory of the webapp. I'm using Mono's ASP.NET auto-configuration so I *think* what happens is Mono configures the "~" path (as in, Server.MapPath("~")) relative to the first .aspx page that's loaded. But I probably can just fix this by specifically configuring the webapp in the Apache config file. o We're using https for our site and have found that Mono cannot handle loading the same webpage using both http:// and https:// For example, if I load http://www.mysite.com/default.aspx, and then later https://www.mysite.com/default.aspx, it barfs. It looks like it stays configured to whatever was first loaded (if http first, then only http works / if https first, then only https works). Now this is also not a big deal since I just need to stratify the webapp into separate http and https pieces and use Apache to setup different VirtualHosts. o Mono doesn't let you change around the .aspx page on-the-fly like MS ASP.NET does. For example, if you have a button with an OnClick method like: <asp:Button id="fooButton" OnClick="FooClick" runat="server" /> you cannot remove the OnClick attribute w/o recompiling on Mono, MS you can. o Had to use the deprecated ServicePointManager.CertificatePolicy method for SSL communication with Google. Mono does not yet implement the newer method using ServerCertificateValidationCallback. Other than these few small hindrances, Mono worked great. Thank you, again, for such a quality product! -Abe PS - If you're interested in what Obtuse Software does, you can checkout the press release here: http://www.obtusesoft.com/pr.html zigGIS (Obtuse Software's inaugural product) is an Open Source GIS extension to ESRI ArcMap. ****************************************************************** This message originated from the Internet. Its originator may or may not be who they claim to be and the information contained in the message and any attachments may or may not be accurate. ****************************************************************** _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list ------------------------ ****************************************************************** This message originated from the Internet. Its originator may or may not be who they claim to be and the information contained in the message and any attachments may or may not be accurate. ****************************************************************** ****************************************************************** This E-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return E-mail. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. ****************************************************************** SAVE PAPER - THINK BEFORE YOU PRINT! ****************************************************************** This message originated from the Internet. Its originator may or may not be who they claim to be and the information contained in the message and any attachments may or may not be accurate. ******************************************************************
_______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
