<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Jason Bock's Weblog - Recent Comments</title>
    <link>http://www.jasonbock.net/JB</link>
    <description>Writing code, creating books, playing video games, and other stuff</description>
    <image>
      <url>http://www.jasonbock.net/JB/Images/Jason.jpg</url>
      <link>http://www.jasonbock.net/JB/Images/Jason.jpg</link>
      <title>Jason Bock's Weblog</title>
    </image>
    <language>en</language>
    <copyright>Copyright 2008 Jason Bock</copyright>
    <lastBuildDate>Mon, 30 Aug 2010 03:52:31 GMT</lastBuildDate>
    <managingEditor>jason@jasonbock.net</managingEditor>
    <item>
      <title>It's easier than that....</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.f48ab22438bc4e35969ca6c559763e9c#49af1caca73442d198d9289afd8b3f8c</link>
      <description>Greg B&lt;br/&gt;&lt;br/&gt;After some more digging, I realized that it wasn't log4net's serialization that doesn't work, but I wasn't using it properly.  You can get rid of all the junk in CrossAppDomain logger that pulls out and saves the logging information in LoggingHelper's constructor by putting in:&lt;br/&gt;&lt;br/&gt;loggingEvent.Fix = FixFlags.All;&lt;br/&gt;this.loggingEvent = loggingEvent;&lt;br/&gt;&lt;br/&gt;Then, in the Log() method don't recreate a new LoggingEvent, simply use this.loggingEvent.</description>
      <pubDate>Mon, 30 Aug 2010 03:52:31 GMT</pubDate>
      <guid isPermaLink="false">49af1caca73442d198d9289afd8b3f8c</guid>
    </item>
    <item>
      <title>Programmer</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.f48ab22438bc4e35969ca6c559763e9c#99fbc874bc2f4ad0a327e3bdb1b20652</link>
      <description>Greg B&lt;br/&gt;&lt;br/&gt;This is a pretty old thread, but since I stumbled up on it now, perhaps it will help others...&lt;br/&gt;&lt;br/&gt;The issue that some may have with the minimal lock is that is is much slower, which may or may not be an issue for you.  The other reason this didn't work for me is that we ship or logs off as soon as the lock on it is released.  With minimal lock, the log file would get whisked away all the time.&lt;br/&gt;&lt;br/&gt;The modification making a &amp;quot;SharedLock&amp;quot; locking mechanism (suggested above) and allowing Read AND write is that when it comes time to roll the file, it can't because one of the two AppDomain's will still have access to it.&lt;br/&gt;&lt;br/&gt;But, all hope is not lost and if you want to spend some time you can do this without modifying any log4net code, but does involve creating your own appender, which can live anywhere.  I called mine CrossAppDomainAppender and his constructor takes an AppDomain, which will be the original one that has the file lock, which is where I want my log messages.  &lt;br/&gt;&lt;br/&gt;After you create your new AppDomain, you typically call the .CreateInstanceFromAndUnWrap or similar.  One of the overloaded methods allows you to pass an argument to the created object's constructor.  Pass in AppDomain.CurrentAppDomain.  Then, in the constructor, you'll create a new instance of the CrossAppDomainAppender (below), passing it the AppDomain in question.  Then simply pass that instance of CrossAppDomainAppender to log4net.Config.BasicConfigurator.Configure(IAppender). &lt;br/&gt;&lt;br/&gt;Anything in the new domain that calls an ILog logging method will append to the CrossAppDomainAppender, which will in turn write it to all appenders in the desired domain.  I'm sure this can be improves some, but here is the appender and helper class.&lt;br/&gt;&lt;br/&gt;public class CrossAppDomainAppender : AppenderSkeleton&lt;br/&gt;{&lt;br/&gt;    private AppDomain domainToLogTo;&lt;br/&gt;    &lt;br/&gt;    public CrossAppDomainAppender(AppDomain domainToLogTo)&lt;br/&gt;    {&lt;br/&gt;        this.domainToLogTo = domainToLogTo;&lt;br/&gt;    }&lt;br/&gt;&lt;br/&gt;    protected override void Append(LoggingEvent loggingEvent)&lt;br/&gt;    {&lt;br/&gt;        LoggingHelper loggingHelper = new LoggingHelper(loggingEvent);&lt;br/&gt;        domainToLogTo.DoCallBack(loggingHelper.Log);&lt;br/&gt;    }&lt;br/&gt;&lt;br/&gt;    [Serializable]&lt;br/&gt;    private class LoggingHelper&lt;br/&gt;    {&lt;br/&gt;        //Logging data&lt;br/&gt;        private string domain;&lt;br/&gt;        private string exceptionString;&lt;br/&gt;        private string identity;&lt;br/&gt;        private Level level;&lt;br/&gt;        private string loggerName;&lt;br/&gt;        private string message;&lt;br/&gt;        private log4net.Util.PropertiesDictionary properties;&lt;br/&gt;        private string threadName;&lt;br/&gt;        private DateTime timeStamp;&lt;br/&gt;        private string userName;&lt;br/&gt;        &lt;br/&gt;        //Location Information&lt;br/&gt;        private string className;&lt;br/&gt;        private string methodName;&lt;br/&gt;        private string fileName;&lt;br/&gt;        private string lineNumber;&lt;br/&gt;&lt;br/&gt;        public LoggingHelper(LoggingEvent loggingEvent)&lt;br/&gt;        {&lt;br/&gt;            //Even though LoggingEvent is marked serializable, not everything is saved correctly, so&lt;br/&gt;            //keep our own copy of everything.&lt;br/&gt;            domain = loggingEvent.Domain;&lt;br/&gt;            exceptionString = loggingEvent.GetExceptionString();&lt;br/&gt;            identity = loggingEvent.Identity;&lt;br/&gt;            level = loggingEvent.Level;&lt;br/&gt;            loggerName = loggingEvent.LoggerName;&lt;br/&gt;            message = loggingEvent.MessageObject == null ? &amp;quot;&amp;quot; : loggingEvent.MessageObject.ToString();&lt;br/&gt;            properties = loggingEvent.Properties;&lt;br/&gt;            threadName = loggingEvent.ThreadName;&lt;br/&gt;            timeStamp = loggingEvent.TimeStamp;&lt;br/&gt;            userName = loggingEvent.UserName;&lt;br/&gt;&lt;br/&gt;            //Location info&lt;br/&gt;            className = loggingEvent.LocationInformation.ClassName;&lt;br/&gt;            methodName = loggingEvent.LocationInformation.MethodName;&lt;br/&gt;            fileName = loggingEvent.LocationInformation.FileName;&lt;br/&gt;            lineNumber = loggingEvent.LocationInformation.LineNumber;&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        public void Log()&lt;br/&gt;        {&lt;br/&gt;            LoggingEventData data = new LoggingEventData();&lt;br/&gt;            data.LocationInfo = new LocationInfo(className, methodName, fileName, lineNumber);&lt;br/&gt;            data.Domain = domain;&lt;br/&gt;            data.ExceptionString = exceptionString;&lt;br/&gt;            data.Identity = identity;&lt;br/&gt;            data.Level = level;&lt;br/&gt;            data.LoggerName = loggerName;&lt;br/&gt;            data.Message = message;&lt;br/&gt;            data.Properties = properties;&lt;br/&gt;            data.ThreadName = threadName;&lt;br/&gt;            data.TimeStamp = timeStamp;&lt;br/&gt;            data.UserName = userName;&lt;br/&gt;&lt;br/&gt;            LoggingEvent loggingEvent = new LoggingEvent(data);&lt;br/&gt;            foreach (log4net.Repository.ILoggerRepository repository in log4net.LogManager.GetAllRepositories())&lt;br/&gt;            {&lt;br/&gt;                repository.Log(loggingEvent);&lt;br/&gt;            }&lt;br/&gt;        }&lt;br/&gt;    }&lt;br/&gt;}</description>
      <pubDate>Thu, 26 Aug 2010 20:06:10 GMT</pubDate>
      <guid isPermaLink="false">99fbc874bc2f4ad0a327e3bdb1b20652</guid>
    </item>
    <item>
      <title>Good movie, also</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.81799a2a99674c2c96eca9b4938fd1c5#6a11e77408a2479985d915c939bc3f59</link>
      <description>Chuck&lt;br/&gt;&lt;br/&gt;It's a pretty good movie, also.  Shot in Minnesota.</description>
      <pubDate>Thu, 12 Aug 2010 16:30:47 GMT</pubDate>
      <guid isPermaLink="false">6a11e77408a2479985d915c939bc3f59</guid>
    </item>
    <item>
      <title>Read [1] :)</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.21354be10f914814b767cfa6d1162b68#b587003507a74e6c810a3e63cc480c8f</link>
      <description>&lt;a href="http://www.jasonbock.net/" target="_blank"&gt;Jason Bock&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Justin,&lt;br/&gt;&lt;br/&gt;My [1] footnote mentions that. I've tried Reduce before but it doesn't seem to do any mathematical symbolic reduction, which, to be honest, would've really surprised me if it would've been as sophisticated as what Mathematica can do.</description>
      <pubDate>Wed, 30 Jun 2010 13:48:57 GMT</pubDate>
      <guid isPermaLink="false">b587003507a74e6c810a3e63cc480c8f</guid>
    </item>
    <item>
      <title>expression reduce?</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.21354be10f914814b767cfa6d1162b68#c448a45738f841c1ab72adf3d2abbbc9</link>
      <description>&lt;a href="http://www.justinmchase.com/" target="_blank"&gt;Justin&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;There is a Reduce() function on LambdaExpression (maybe all expressions?), I think it does logical reduction but I wonder if it wouldn't also do mathematical reduction? It might be that smart.</description>
      <pubDate>Wed, 30 Jun 2010 13:21:49 GMT</pubDate>
      <guid isPermaLink="false">c448a45738f841c1ab72adf3d2abbbc9</guid>
    </item>
    <item>
      <title>What I'd search for</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.21354be10f914814b767cfa6d1162b68#66bfa4047534490dad723e841ab71679</link>
      <description>&lt;a href="http://www.nitriq.com/" target="_blank"&gt;Jon von Gillern&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;I understand how frustrating it can be when your &amp;quot;search-fu&amp;quot; stops working. &lt;br/&gt;&lt;br/&gt;Here is what I would search on&lt;br/&gt;&amp;quot;how to factor a polynomial equation&amp;quot;&lt;br/&gt;&lt;br/&gt;The first result: http://oakroadsystems.com/math/polysol.htm#StandardForm&lt;br/&gt;&lt;br/&gt;While a little dense, it will would hopefully get farther down that road.&lt;br/&gt;&lt;br/&gt;I also searched for &amp;quot;algebraic identities&amp;quot;, and while somewhat helpful didn't yield exactly what I was hoping for.&lt;br/&gt;&lt;br/&gt;</description>
      <pubDate>Tue, 29 Jun 2010 19:54:27 GMT</pubDate>
      <guid isPermaLink="false">66bfa4047534490dad723e841ab71679</guid>
    </item>
    <item>
      <title>Clarifications</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.19b45b7cd11b422c86c694a5ce9d298b#dd83a1bc7f104f65b9287945abbb95c0</link>
      <description>&lt;a href="http://www.jasonbock.net/" target="_blank"&gt;Jason Bock&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Mindviews,&lt;br/&gt;&lt;br/&gt;That may read &amp;quot;better&amp;quot;, although that seems like a personal preference.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Kasper,&lt;br/&gt;&lt;br/&gt;My article wasn't inspired by the content from those articles. They may be related but my post came from a problem I ran into in my code.</description>
      <pubDate>Tue, 29 Jun 2010 14:24:09 GMT</pubDate>
      <guid isPermaLink="false">dd83a1bc7f104f65b9287945abbb95c0</guid>
    </item>
    <item>
      <title>Cite please</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.19b45b7cd11b422c86c694a5ce9d298b#f7b7fe9c71d24e6994b311e224baee63</link>
      <description>Kasper Frank&lt;br/&gt;&lt;br/&gt;Please cite your source of inspiration:&lt;br/&gt;http://haacked.com/archive/2010/06/16/null-or-empty-coalescing.aspx&lt;br/&gt;http://ayende.com/Blog/archive/2010/06/10/checking-for-empty-enumerations.aspx</description>
      <pubDate>Thu, 24 Jun 2010 07:30:41 GMT</pubDate>
      <guid isPermaLink="false">f7b7fe9c71d24e6994b311e224baee63</guid>
    </item>
  </channel>
</rss>