• <tfoot id='5Poii'></tfoot>
      <bdo id='5Poii'></bdo><ul id='5Poii'></ul>

    <small id='5Poii'></small><noframes id='5Poii'>

    <legend id='5Poii'><style id='5Poii'><dir id='5Poii'><q id='5Poii'></q></dir></style></legend>

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

        在 Eclipse 4 (RCP/SWT/OSGi) 应用程序中包含 log4j 的正确方法

        时间:2023-08-20
        <tfoot id='ZRZXM'></tfoot>
          <tbody id='ZRZXM'></tbody>

        1. <small id='ZRZXM'></small><noframes id='ZRZXM'>

            <bdo id='ZRZXM'></bdo><ul id='ZRZXM'></ul>

              <legend id='ZRZXM'><style id='ZRZXM'><dir id='ZRZXM'><q id='ZRZXM'></q></dir></style></legend>
                1. <i id='ZRZXM'><tr id='ZRZXM'><dt id='ZRZXM'><q id='ZRZXM'><span id='ZRZXM'><b id='ZRZXM'><form id='ZRZXM'><ins id='ZRZXM'></ins><ul id='ZRZXM'></ul><sub id='ZRZXM'></sub></form><legend id='ZRZXM'></legend><bdo id='ZRZXM'><pre id='ZRZXM'><center id='ZRZXM'></center></pre></bdo></b><th id='ZRZXM'></th></span></q></dt></tr></i><div id='ZRZXM'><tfoot id='ZRZXM'></tfoot><dl id='ZRZXM'><fieldset id='ZRZXM'></fieldset></dl></div>
                  本文介绍了在 Eclipse 4 (RCP/SWT/OSGi) 应用程序中包含 log4j 的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这是一个后续(不知何故我的 第三方对 OSGi 应用程序的依赖项) 建议一些库,例如log4j已经可以作为包使用了.
                  在 Eclipse Indigo 中,我在安装过程中找不到可用于 Import Package 的 log4j 包,因此我创建了一个 Plugin Project from JAR archive 来捆绑 log4j 和一个 Feature Project 在 log4j.xml 配置">发布.

                  This is a follow-up (somehow of my Third-party dependencies to an OSGi application) where it was suggested that some libraries e.g. log4j are already available as bundles.
                  In Eclipse Indigo I could not find a log4j bundle available to Import Package as part of my installation and so I created a Plugin Project from JAR archive to bundle log4j and also a Feature Project to bundle the log4j.xml configuration following this post.

                  说实话,我不明白为什么需要片段项目,但这个过程有效.
                  所以我现在的问题是:
                  由于 log4j.xml 作为功能 jar 的一部分在导出中交付,因此需要一些努力"才能找到它并更新调试级别,所以我想知道这确实是正确的过程?
                  我记得最终导出的产品会在一个容易找到的位置提供 log4j 配置,但现在(尽管日志记录有效)我担心我所做的是否确实正确.

                  To be honest I don't understand why the fragment project is needed but this process works.
                  So my question now is:
                  Since the log4j.xml is delivered in the export as part of the feature jar, it requires some "effort" for someone to find it and update the debug levels, so I was wondering is this indeed the correct process?
                  I had in mind that the final exported product would deliver the log4j configuration in an easy to find location, but now (although the logging works) I am concerned whether what I do, is indeed correct.

                  这里有什么帮助吗?

                  推荐答案

                  如果你真的需要暴露文件,你可以把它放在你想要的任何地方,然后确保你的程序在启动时调用这些方法之一:

                  If you really need to expose the file, you could put it anywhere you want, and then make sure your program calls one of these methods at startup:

                  • org.apache.log4j.xml.DOMConfigurator.配置(字符串文件名)
                  • org.apache.log4j.PropertyConfigurator.配置(String配置文件名)
                  • org.apache.log4j.xml.DOMConfigurator.configure(String filename)
                  • org.apache.log4j.PropertyConfigurator.configure(String configFilename)

                  如果您想在不重新启动应用程序的情况下更改配置,请使用configureAndWatch"变体.

                  Or use the "configureAndWatch"-variants if you would like to make changes to the config without restarting your application.

                  编辑:我写如果你真的需要的话",因为我经历过部署后我永远不需要打开调试日志,因为它总是打开的!这对于我对响应时间和吞吐量有正常(但不是极端)要求的应用程序来说是可以的.记录到 UDP-appender 很快(并且不会填满磁盘).或者使用滚动文件附加程序是非常安全的,并且足够快以供我使用.在确定那些难以重现的错误时,始终提供可用的调试日志是一种救命稻草.

                  Edit: I write "If you really need to", because I have experienced that I never need to turn on debug-logging after deployment, because it is always turned on! This is OK for applications where I have normal (but not extreme) requirements on response-time and throughput. Logging to an UDP-appender is fast (and does not fill up the disk). Or using rolling file appender is quite safe, and fast enough for my use. Always having the debug-log available is a life-saver when nailing down those hard-to-reproduce bugs.

                  这篇关于在 Eclipse 4 (RCP/SWT/OSGi) 应用程序中包含 log4j 的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Eclipse 中使用 EclEmma 插件排除类和包 下一篇:在 Project Explorer (Eclipse) 中查找项目位置

                  相关文章

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

                    <tfoot id='bwgiH'></tfoot>

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