Tomcat 和 logback.xml
我正在启动一个部署到 Tomcat 6
的 Seam + Hibernate + Logback
项目。我使用 Eclipse 作为 IDE
。 Hibernate 打印了许多调试语句,因此我将级别设置为 ERROR
,因此我看不到它们。
<logger name="org.hibernate">
<level value="ERROR" />
</logger>
我没有粘贴整个 logback.xml
,因为我遇到的问题与其内容无关。
我有以下类路径问题 - 如果我将 logback.xml
放入项目的 WEB-INF\classes
中,则类加载器找不到它,并且我会看到所有调试声明。另一方面,如果我将 logback.xml
移动到 Tomcat
的 lib
目录,则一切正常,并且不会打印调试语句。
但我希望将 logback.xml
放在我的项目中,而不是放在 Tomcat 的根 lib
目录中。
这是我的问题 - WEB-INF\classes
不是 logback.xml
的正确位置吗?为什么找不到?
我一直都知道项目的WEB-INF\classes
目录下的文件,是放到classpath下的。感谢您的任何想法。
祝一切顺利,佩塔尔
I am starting up a Seam + Hibernate + Logback
project deployed to Tomcat 6
. I use Eclipse as an IDE
. Hibernate prints many debug statements, so I have put the level to ERROR
, so I don't see them.
<logger name="org.hibernate">
<level value="ERROR" />
</logger>
I don't paste my whole logback.xml
, because the problem I have, is not connected with its contents.
I have the following classpath problem - If I put the logback.xml
in WEB-INF\classes
of my project, it is not found by the classloader and I see all debug statements. On the other hand, if I move the logback.xml
to the lib
directory of Tomcat
, everything works perfect and the debug statements are not printed.
But I want to have my logback.xml
inside my project, not in the root lib
directory of Tomcat.
And here is my question - isn't the WEB-INF\classes
a correct place for logback.xml
? Why isn't it found?
I have always known that the files under the WEB-INF\classes
directory of the project, are put to the classpath. Thank you for any ideas you have.
All the best, Petar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您的
logback.jar
也在${catalina.home}\lib
下。如果您想将
logback.xml
放入\WEB-INF\classes
,则logback.jar
应该仅位于\ WEB-INF\lib
。应删除${catalina.home}\lib\logback.jar
。It looks like your
logback.jar
is also under${catalina.home}\lib
.If you want to put your
logback.xml
to\WEB-INF\classes
, thelogback.jar
should be only under\WEB-INF\lib
. The${catalina.home}\lib\logback.jar
should be removed.