Пример #1
0
        public virtual void TestAppenderDefined()
        {
            HttpRequestLogAppender requestLogAppender = new HttpRequestLogAppender();

            requestLogAppender.SetName("testrequestlog");
            Logger.GetLogger("http.requests.test").AddAppender(requestLogAppender);
            RequestLog requestLog = HttpRequestLog.GetRequestLog("test");

            Logger.GetLogger("http.requests.test").RemoveAppender(requestLogAppender);
            NUnit.Framework.Assert.IsNotNull("RequestLog should not be null", requestLog);
            Assert.Equal("Class mismatch", typeof(NCSARequestLog), requestLog
                         .GetType());
        }
Пример #2
0
        public virtual void TestStartedServerWithRequestLog()
        {
            HttpRequestLogAppender requestLogAppender = new HttpRequestLogAppender();

            requestLogAppender.SetName("httprequestlog");
            requestLogAppender.SetFilename(Runtime.GetProperty("test.build.data", "/tmp/") +
                                           "jetty-name-yyyy_mm_dd.log");
            Logger.GetLogger(typeof(HttpServer2).FullName + ".test").AddAppender(requestLogAppender
                                                                                 );
            HttpServer2 server = null;

            server = CreateTestServer();
            AssertNotLive(server);
            server.Start();
            AssertAlive(server);
            Stop(server);
            Logger.GetLogger(typeof(HttpServer2).FullName + ".test").RemoveAppender(requestLogAppender
                                                                                    );
        }