科贝图拉的副作用
经过一番努力,我终于让 cobertura 在 tomcat 服务器。一切看起来都很好,直到我将其提交给 svn 并且 hudson 完成(失败)了他的工作。如果没有这个构建脚本,我永远不会(或以后)发现这个问题。我的构建脚本尝试将 catalina.log 移动到另一个目录,但 catalina.log 丢失了。经过一些测试后,我假设类路径中 cobertura.jar 的纯粹存在(没有检测任何内容)会改变我的 tomcat 的日志记录行为。
由于我对 tomcat 和 cobertura 都没有那么丰富的经验,所以任何人都可以证实我的观察。是否有任何其他副作用记录?
After some efforts I finally get cobertura running correctly for my web application on a tomcat server. Everything seems fine until I committed it to the svn and hudson finished(failed) his work. Without this build script I would have never (or later) discovered this issue. My build script tried to move the catalina.log to another directory but the catalina.log was missing. After some testing I assume that the pure presence of the cobertura.jar in classpath (without instrumenting anything) changes the logging behaviour of my tomcat.
Since I'm not that experienced with neither tomcat nor cobertura, can anyone confirm my observation. Are there anywhere any other side effects documented?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
cobertura jar 文件中有一个 log4j.properties 。
如果您使用 log4j 进行日志记录,则该文件可能用于日志记录配置(log4j 从类路径中获取第一个 log4.properties 并使用它)。
您可以从库中删除此文件,或者确保您的日志记录配置位于类路径中的第一个。
如果您提供 -Dlog4j.debug=true log4j 会告诉您它使用哪个日志记录配置文件。
there is a log4j.properties in the cobertura jar files.
If you log with log4j, maybe this file is used for logging configuration (log4j takes the first log4.properties from the classpath and uses this).
you could remove this file from the lib OR make sure, that your logging configuration is first in the classpath.
If you supply -Dlog4j.debug=true log4j will tell you, which logging configuration file it uses.