diff --git a/test/ring/async_logger_test.clj b/test/ring/async_logger_test.clj index 0a880cc..f72bd05 100644 --- a/test/ring/async_logger_test.clj +++ b/test/ring/async_logger_test.clj @@ -544,10 +544,7 @@ finish)) (is (pos? elapsed)))))) -;; This test is similar to ring.logger-test/tools-logging-test, -;; only it uses the async middleware. However, for some reason -;; one of the tests fails when both of them are enabled. -#_(deftest tools-logging-test +(deftest tools-logging-test (let [handler (-> ok-handler logger/wrap-with-logger wrap-params) diff --git a/test/ring/logger_test.clj b/test/ring/logger_test.clj index f9289a9..fef1b2c 100644 --- a/test/ring/logger_test.clj +++ b/test/ring/logger_test.clj @@ -8,7 +8,8 @@ [ring.logger.compat :as logger.compat] [ring.mock.request :as mock]) (:import - [java.io ByteArrayOutputStream PrintStream])) + [java.io ByteArrayOutputStream PrintStream] + [org.apache.log4j LogManager])) (def ok-handler (fn [req] @@ -347,6 +348,8 @@ tmp-out# (PrintStream. out-buffer# true "UTF-8")] (try (System/setOut tmp-out#) + ;; The console appender needs to be re-activated to ensure it sees the new value of System/out + (.activateOptions (.getAppender (LogManager/getRootLogger) "console")) ~@body (finally (System/setOut original-out#)))