Eclipse 中的 @Profiled 注释(用于使用 Perf4j 日志记录)

发布于 2024-10-03 20:00:07 字数 319 浏览 0 评论 0原文

我试图在我的 Eclipse 项目中使用 Perf4j 获取 @Profiled 注释来计时(和记录)方法调用。这使用了aspectj。我使用 Perf4j 开发人员指南< /a>.但是,当我在 Eclipse 项目中运行相同的代码时,不会创建日志文件。我尝试了很多方法,包括在工厂路径中添加所有注释编织器 jar,但无济于事。

Im trying to get the @Profiled annotation to time (and log) method calls using Perf4j in my eclipse project. This uses aspectj. Ive managed easily to get it to work in the Windows command line with javac using the Perf4j Developers Guide. However the log files aren't created when I run the same code in an eclipse project. Ive tried many things including adding all the annotation weaver jars in the factory path but to no avail.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裸钻 2024-10-10 20:00:07

下载 Eclipse AJDT 插件 并将项目转换为 AspectJ 项目。那么它应该可以工作。

执行以下操作:

  • 标记项目,右键单击它并添加 AspectJ 性质。
  • 在 AspectJ 构建路径上,您必须添加包含方面的 jar 文件。如果该方面是项目的一部分而不是依赖项,请忽略这一点。

Download the Eclipse AJDT plugin and convert the project to a AspectJ project. Then it should work.

Do the following:

  • Mark the project, right click on it and add AspectJ nature.
  • On the AspectJ build-path you must add the jar file with the aspects. Ignore this if the aspect is part of the project and not a dependency.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文