Log4j - 寻找一个好的“入门”教程或博客

发布于 2024-10-06 15:22:43 字数 1536 浏览 0 评论 0原文

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

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

发布评论

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

评论(2

So要识趣 2024-10-13 15:22:43

log4j 简介 是 log4j 的一个非常好的起点。

如果您准备花一些钱,可以购买 log4j 手册

顺便说一句,如果您不熟悉 Java 登录,我建议您使用 slf4j + logback 组合。在我看来,这是最好的日志记录解决方案。 Slf4j 是一个日志记录“外观”,它需要一个底层实现。可以使用Log4j和logback作为实现。

由于 logback 是 log4j 的继承者并且由同一作者制作,因此我建议使用它。不仅如此,logback 的手册可以在线获取,而且是免费的。

由于log4j的发展或多或少已经停滞,我建议您升级到slf4j + logback。

The short introduction to log4j is a perfectly fine starting point for log4j.

If you're ready to spend some money, you can buy the log4j manual.

By the way, if you're new to logging in Java, I'd suggest the slf4j + logback combo. In my opinion, this is the best logging solution available. Slf4j is a logging "facade" and it needs an implementation underneath. Log4j and logback can be used as implementations.

Since logback is log4j's successor and made by the same author, I'd suggest using it instead. Not only that, logback's manual is available online and it's free.

Since log4j's development has more or less stalled, I'd suggest you upgrade to slf4j + logback.

很酷不放纵 2024-10-13 15:22:43

请看看这个"如何集成log4j Java 项目” 可以帮助您。它会带您完成 5 个快速步骤。

  • 使用 log4j 设置项目
  • 创建 log4j.properties 文件
  • 编写一个类来记录日志消息
  • 编译并运行程序
  • 检查日志消息

即使问题较旧,因为您已经要求提供有关如何快速入门的教程或博客文章,我想到了分享这个。

Please see whether this "How to integrate log4j with Java project" helps you. It takes you through 5 quick steps.

  • Set up the project with log4j
  • Create log4j.properties file
  • Write a class to record log messages
  • Compile and run program
  • Check the log messages

Even though the question is older, as you have asked for a tutorial or a blog post on how to get started quickly, I thought of sharing this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文