• <i id='iKpUb'><tr id='iKpUb'><dt id='iKpUb'><q id='iKpUb'><span id='iKpUb'><b id='iKpUb'><form id='iKpUb'><ins id='iKpUb'></ins><ul id='iKpUb'></ul><sub id='iKpUb'></sub></form><legend id='iKpUb'></legend><bdo id='iKpUb'><pre id='iKpUb'><center id='iKpUb'></center></pre></bdo></b><th id='iKpUb'></th></span></q></dt></tr></i><div id='iKpUb'><tfoot id='iKpUb'></tfoot><dl id='iKpUb'><fieldset id='iKpUb'></fieldset></dl></div>
    <tfoot id='iKpUb'></tfoot>

    <legend id='iKpUb'><style id='iKpUb'><dir id='iKpUb'><q id='iKpUb'></q></dir></style></legend>
      <bdo id='iKpUb'></bdo><ul id='iKpUb'></ul>

    <small id='iKpUb'></small><noframes id='iKpUb'>

      1. 你觉得 java.util.logging 足够了吗?

        时间:2023-09-25
          <bdo id='d5NMV'></bdo><ul id='d5NMV'></ul>

            • <tfoot id='d5NMV'></tfoot>

              <legend id='d5NMV'><style id='d5NMV'><dir id='d5NMV'><q id='d5NMV'></q></dir></style></legend>

                  <tbody id='d5NMV'></tbody>

                  <small id='d5NMV'></small><noframes id='d5NMV'>

                  <i id='d5NMV'><tr id='d5NMV'><dt id='d5NMV'><q id='d5NMV'><span id='d5NMV'><b id='d5NMV'><form id='d5NMV'><ins id='d5NMV'></ins><ul id='d5NMV'></ul><sub id='d5NMV'></sub></form><legend id='d5NMV'></legend><bdo id='d5NMV'><pre id='d5NMV'><center id='d5NMV'></center></pre></bdo></b><th id='d5NMV'></th></span></q></dt></tr></i><div id='d5NMV'><tfoot id='d5NMV'></tfoot><dl id='d5NMV'><fieldset id='d5NMV'></fieldset></dl></div>
                  本文介绍了你觉得 java.util.logging 足够了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  根据标题,您是否发现默认的 Java 日志框架足以满足您的需求?

                  Per the title, do you find the default Java logging framework sufficient for your needs?

                  您是否使用替代的日志记录服务,例如 log4j 或其他?如果是这样,为什么?我想听听您对不同类型项目的日志记录要求的任何建议,以及何时集成框架实际上是必要和/或有用的.

                  Do you use alternative logging services such as log4j or others? If so, why? I'd like to hear any advice you have regarding logging requirements in different types of projects, and when integrating frameworks is actually necessary and/or useful.

                  推荐答案

                  使用第三方库记录依赖关系

                  在大多数情况下,Java JDK 日志记录本身并不够.但是,如果您有一个使用多个开源第三方库的大型项目,您会很快发现其中许多具有不同的日志记录依赖项.

                  Logging Dependencies with Third Party Libraries

                  Java JDK logging in most cases is not insufficient by itself. However, if you have a large project that uses multiple open-source third party libraries, you will quickly discover that many of them have disparate logging dependencies.

                  正是在这些情况下,从日志实现中抽象出日志 API 的需求变得很重要.我推荐使用 slf4j 或 logback(使用 slf4j API)作为您的 API,如果您想坚持使用 Java JDK 日志记录,您仍然可以!Slf4j 可以毫无问题地输出到许多不同的记录器实现.

                  It is in these cases where the need to abstract your logging API from your logging implementation become important. I recommend using slf4j or logback (uses the slf4j API) as your API and if you want to stick with Java JDK logging, you still can! Slf4j can output to many different logger implementations with no problems.

                  在最近的一个项目中发生了它有用的一个具体例子:我们需要使用需要 log4j 的第三方库,但我们不想并排运行两个日志框架,所以我们使用了 slf4j log4j api 包装器库问题就解决了.

                  A concrete example of its usefulness happened during a recent project: we needed to use third-party libs that needed log4j, but we did not want to run two logging frameworks side by side, so we used the slf4j log4j api wrapper libs and the problem was solved.

                  总而言之,Java JDK 日志记录很好,但从长远来看,我的第三方库中使用的标准化 API 将节省您的时间.试想一下重构每个日志语句!

                  In summary, Java JDK logging is fine, but a standardized API that is used in my third party libraries will save you time in the long run. Just try to imagine refactoring every logging statement!

                  这篇关于你觉得 java.util.logging 足够了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:用于 Web 的 Java 开发 下一篇:Java 开源文本挖掘框架

                  相关文章

                  <small id='NfKWo'></small><noframes id='NfKWo'>

                    <legend id='NfKWo'><style id='NfKWo'><dir id='NfKWo'><q id='NfKWo'></q></dir></style></legend>
                        <bdo id='NfKWo'></bdo><ul id='NfKWo'></ul>

                    1. <i id='NfKWo'><tr id='NfKWo'><dt id='NfKWo'><q id='NfKWo'><span id='NfKWo'><b id='NfKWo'><form id='NfKWo'><ins id='NfKWo'></ins><ul id='NfKWo'></ul><sub id='NfKWo'></sub></form><legend id='NfKWo'></legend><bdo id='NfKWo'><pre id='NfKWo'><center id='NfKWo'></center></pre></bdo></b><th id='NfKWo'></th></span></q></dt></tr></i><div id='NfKWo'><tfoot id='NfKWo'></tfoot><dl id='NfKWo'><fieldset id='NfKWo'></fieldset></dl></div>
                      <tfoot id='NfKWo'></tfoot>