我正在将 displaytag 库集成到我的 Web 应用程序中。我在工作中使用过该库,但我目前正在构建的内容目前没有它。当我去查看库安装的依赖项时,我注意到它列出了以下内容...
commons-logging
commons-lang
commons-collections
commons-beanutils
log4j
我相信我已经提供了它所需的所有 commons 依赖项,但我注意到它还具有 log4j。我目前没有使用 log4j 作为我的日志记录,所以我很好奇如果我没有设置 log4j 它是否实际上不起作用,或者它是否会很好并且只需要它可用。
提供的安装文档中并没有真正提到它
显示标签安装
I am integrating the displaytag library into my web application. I have used the library at my work, but what I am currently building does not have it currently. When I went to review the dependencies for installation of the library, I noticed that it had the following listed...
commons-logging
commons-lang
commons-collections
commons-beanutils
log4j
I believe that I have provided all of the commons dependencies that it needs, but I noticed that it also has log4j. I am not currently using log4j as my logging, so I am curious if it will in fact not work if I dont have log4j set up, or if it will be fine and just needs it available.
It doesn't really mention in the installation documentation provided at
Display Tag Installation
发布评论
评论(2)
此链接似乎表明 log4j 是可选(至少对于 1.2 版本)。
同一页面提到 slf4j 是非可选,表明该库已使用 slf4j。如果是这样,可以用任何其他日志记录提供程序代替 log4j。
This link seems to indicate that log4j is Optional (at least for version 1.2).
The same page mentions that slf4j is Not optional, indicating that the library has been coded using slf4j. If so, instead of log4j, any other logging provider can be substituted.
正如 Raghuram 所提到的,虽然 log4j 对于 displaytag 是可选的,而 slf4j 不是可选的,但 slf4j 反过来又依赖于 log4j 并且它不是可选的。 链接
基本上displaytag间接需要log4j,如上所述此处。
As mentioned by Raghuram, although log4j is optional for displaytag and slf4j is not optional, the slf4j in turn has a dependency on log4j and it is not optional. Link
Basically displaytag needs log4j indirectly as mentioned here.