[ http://issues.apache.org/jira/browse/IBATISNET-65?page=comments#action_65820 ] Ron Grabowski commented on IBATISNET-65: ----------------------------------------
log4net is in a perpetual state of beta. I wouldn't be surprised if the next stable release wasn't until the end of the year. Did you know the last stable release of log4net (1.1.1) was released 4/13/2002? http://tinyurl.com/aheal http://www.mail-archive.com/log4net-user%40logging.apache.org/msg01434.html Version 1.2.0.30714 (1.2.0 beta 8), the version that everyone (including IBatisNet) uses, was released 7/15/2003. Its quite stable but it has one or two annonynances that cause can cause big heachaches. The FileAppender class has a particularly nasty bug in how it attempts to open a file for writing. If you're running a web app and the account you're using to log doesn't have proper security permissions to parts of the parent directory structure (i.e. D:\ or D:\HOSTING\ in D:\HOSTING\WEBSITE.COM\LOGS\Log.txt), the FileAppender is unable to log. For localhost or intranet type sites this usually isn't a problem but when an application is deployed to an outside hosting provider (I experienced this problem with www.godaddy.com's .Net hosting) you run into problems. Here is the checkin from 1/14/2004 that fixes this bug: http://tinyurl.com/auzqk http://cvs.sourceforge.net/viewcvs.py/log4net/log4net/src/Appender/FileAppender.cs?r1=1.26&r2=1.27 As you can see from the fix, its a rather simple fix but it can be a show-stopped when you're deploying a site for the first time. I've encountered this bug on two outside hosting providers. No hosting provider gives a specific user account Full Access to the root level drive that is serving pages (D:\). Things also get tricky when you try to work around the problem without patching the code. You can extend FileAppender and override a make a hack-ish fix, but you loose the ability to use RollingFileAppender becuase that extends the broken FileAppender. I explain things more on this thread: http://tinyurl.com/bml99 http://www.mail-archive.com/log4net-user%40logging.apache.org/msg01250.html I would imagine someone else has brought it up at some point in the past but I didn't bother to search the archives that far back. The FileAppender mess and the file locking model in 1.2.0 beta 8 are both avoidable by logging to something other than a FileAppender. For most people starting out with IBatisNet (and log4net) its often easier to start with a FileAppender and move on from there. Another nice feature about the new version is that its easier to automatically tell a FileAppender to log to the virtual directory that the web app is installed to. log4net doesn't natively understand the special ~ token that maps to the virtual directory root: <file value="~\Logs\log.txt" /> You have to make a new class that contains just one override: public class AspNetFileAppender : log4net.Appender.FileAppender { public override string File { get { return base.File; } set { // FileAppender does not understand ASP.Net's tilda character base.File = value.Replace("~/", HttpRuntime.AppDomainAppPath); } } } for FileAppender or RollingFileAppender. Again, not a major fix but some people get scared when they have to override built-in classes. Its now possible to use an external assembly (that has lots more Asp.Net and log4net goodies) to get this value without having to write code by hand: <conversionPattern value="%aspnet-httpRuntime{AppDomainAppPath}\Logs\log.txt" /> I realize not every application is a web app, not everyone uses FileAppenders, and that logging is not the most important thing for an application. At the same time, people do get frustrated with products when they can't get the little things like logging to work. I'd hate for someone to get excited about IBatisNet and have a small snag with getting logging setup right. They read the docs on the log4net website only to find that what should work doesn't and that many things on the log4net website don't apply to IBatisNet's logger. I'm usually not a fan of beta software but the log4net betas are the most stable "betas" I've ever come across. If the upcoming release is pretty much set in stone, then perhaps we can take another look at log4net when the next release of IBatisNet comes out. - Ron > Upgrade to log4net 1.2.9 beta > ----------------------------- > > Key: IBATISNET-65 > URL: http://issues.apache.org/jira/browse/IBATISNET-65 > Project: iBatis for .NET > Type: Improvement > Reporter: Ron Grabowski > Assignee: Gilles Bayon > Priority: Minor > > The current version of log4net is now 1.2.9 beta: > http://logging.apache.org/log4net/downloads.html > Here is a list of changes: > http://logging.apache.org/log4net/release/release-notes.html > All of the documentation on the log4net website is in reference to 1.2.9 beta. > The most important changes for me is the new file locking model for > FileAppender: a FileAppender can be configured to not lock the log file(s) > while the application is running. There are also new members to the ILog > interface. Instead of doing this: > log.Debug(String.Format("Today is {0}.", DateTime.Now.Today)); > log.Info(String.Format("Today is {0}.", DateTime.Now.Today)); > log.Warn(String.Format("Today is {0}.", DateTime.Now.Today)); > log.Error(String.Format("Today is {0}.", DateTime.Now.Today)); > log.Fatal(String.Format("Today is {0}.", DateTime.Now.Today)); > You can now do: > log.DebugFormat("Today is {0}.", DateTime.Now.Today)); > log.InfoFormat("Today is {0}.", DateTime.Now.Today)); > log.WarnFormat("Today is {0}.", DateTime.Now.Today)); > log.FatalFormat("Today is {0}.", DateTime.Now.Today)); > This is akin to StringBuilder's AppendFormat method: > stringBuilder.Append(String.Format("Today is {0}.", DateTime.Now.Today)); > stringBuilder.AppendFormat("Today is {0}.", DateTime.Now.Today)); > I've been using it with my nightly builts of IBatisNet for the past few days > without problems. I just dropped the files into the External-Bin directory > and re-compiled. There were no errors. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira