public void TracingErrorInformation()
        {
            TraceLoggerFactory factory = new TraceLoggerFactory();
            ILogger            logger  = factory.Create(typeof(TraceLoggerTests), LoggerLevel.Debug);

            try
            {
                try
                {
                    string fakearg = "Thisisavalue";
                    throw new ArgumentOutOfRangeException("fakearg", fakearg, "Thisisamessage");
                }
                catch (Exception ex)
                {
                    throw new ApplicationException("Inner error is " + ex.Message, ex);
                }
            }
            catch (Exception ex)
            {
                logger.Error("Problem handled", ex);
            }

            Listener.AssertContains("testsrule", "Castle.Core.Logging.Tests.TraceLoggerTests");
            Listener.AssertContains("testsrule", "Problem handled");
            Listener.AssertContains("testsrule", "ApplicationException");
            Listener.AssertContains("testsrule", "Inner error is");
            Listener.AssertContains("testsrule", "ArgumentOutOfRangeException");
            Listener.AssertContains("testsrule", "fakearg");
            Listener.AssertContains("testsrule", "Thisisavalue");
            Listener.AssertContains("testsrule", "Thisisamessage");
        }
        public void WritingToLoggerByType()
        {
            TraceLoggerFactory factory = new TraceLoggerFactory();
            ILogger            logger  = factory.Create(typeof(TraceLoggerTests), LoggerLevel.Debug);

            logger.Debug("this is a tracing message");

            Listener.AssertContains("testsrule", "Castle.Core.Logging.Tests.TraceLoggerTests");
            Listener.AssertContains("testsrule", "this is a tracing message");
        }
        public void FallUpToDefaultSource()
        {
            TraceLoggerFactory factory = new TraceLoggerFactory();
            ILogger            logger  = factory.Create("System.Xml.XmlDocument", LoggerLevel.Debug);

            logger.Info("Logging to non-configured namespace namespace");

            Listener.AssertContains("defaultrule", "System.Xml.XmlDocument");
            Listener.AssertContains("defaultrule", "Logging to non-configured namespace namespace");
        }
        public void FallUpToShorterSourceName()
        {
            TraceLoggerFactory factory = new TraceLoggerFactory();
            ILogger            logger  = factory.Create(typeof(Configuration.Xml.XmlConfigurationDeserializer), LoggerLevel.Debug);

            logger.Info("Logging to config namespace");

            Listener.AssertContains("configrule", "Castle.Core.Configuration.Xml.XmlConfigurationDeserializer");
            Listener.AssertContains("configrule", "Logging to config namespace");
        }