log4net Error on RC8

Options
xzlxt720
xzlxt720 ✭✭
edited February 2012 in Photon Server
see the following debug message screenshot:



log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [filter] to set object on [Photon.MmoDemo.Client.WinGrid.LogAppender]

this happen when I start Photon.MmoDemo.Client.WinGrid.

Comments

  • The error message means that the <Filter> element in the log appender configuration is not recognized. The reason is that the Photon.MmoDemo.Client.WinGrid.LogAppender class is only implementing the IAppender interface - it should rather inherit from the AppenderSkeleton class.

    You can change the LogAppender class to this implementation, and then it will work with the Filter:
        public class LogAppender : AppenderSkeleton
        {
            public static event Action&lt;string&gt; OnLog;
    
            protected override void Append(LoggingEvent loggingEvent)
            {
                if (OnLog != null)
                {
                    OnLog(string.Format("{0,-5} {1}", loggingEvent.GetLoggingEventData().Level, loggingEvent.MessageObject));
                }
            }
        }
    

    This will also be fixed in the next release. Thanks for letting us know!