无法使用Spring和Clojure记录事件
我正在使用Spring框架和Clojure创建一个web应用程序。为此,我创建了一个扩展无法使用Spring和Clojure记录事件,spring,clojure,log4j,Spring,Clojure,Log4j,我正在使用Spring框架和Clojure创建一个web应用程序。为此,我创建了一个扩展AbstractUrlHandlerMapping的类,然后注册了两个处理程序,如图所示: (:use [clojure.tools.logging :only (debug info error)]) (defn -post-init [this] (do (.registerHandler this "/services.html" (proxy [AbstractControl
AbstractUrlHandlerMapping
的类,然后注册了两个处理程序,如图所示:
(:use [clojure.tools.logging :only (debug info error)])
(defn -post-init [this]
(do
(.registerHandler this "/services.html"
(proxy [AbstractController] []
(handleRequestInternal [request response]
(info "Hello everyone")
(ModelAndView. "services" "lof" "List of services")
)
)
)....
Spring框架生成的所有事件都记录在日志文件中(在类路径中配置了log4j.properties),但没有记录任何应用程序消息 与问题无关,但换行上的近距比较不寻常(其他人会称之为非惯用语)。你看过compojure和hiccup吗?因为如果您使用clojure,我怀疑spring是最好的方式……代码看起来不完整:ns声明的其余部分在哪里?你确定正在调用代码吗?