【问题标题】:How to get rid of the logging startup messages in the console when using PAX logging?使用 PAX 日志记录时如何摆脱控制台中的日志记录启动消息?
【发布时间】:2014-08-27 21:44:52
【问题描述】:

有人要求我在我们的 RCP 应用程序上实现 PAX 日志记录。基本上,我已经关注了这个tutorial

您可能已经注意到,它表示“当您运行 RCP 应用程序时,您应该会看到 Pax ConfMan 将输出记录到您的控制台”。请注意:可以找到配置文件夹,这不是问题。

当我运行我的应用程序时,我得到以下控制台输出:

[Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED
[Start Level Event Dispatcher] DEBUG org.apache.felix.fileinstall - ServiceEvent REGISTERED
[Start Level Event Dispatcher] DEBUG org.apache.felix.fileinstall - ServiceEvent REGISTERED
[Framework Event Dispatcher] DEBUG org.apache.felix.fileinstall - BundleEvent STARTED
[Start Level Event Dispatcher] DEBUG org.eclipse.equinox.cm - ServiceEvent REGISTERED
[Start Level Event Dispatcher] DEBUG org.eclipse.equinox.cm - ServiceEvent REGISTERED
[Start Level Event Dispatcher] DEBUG org.apache.felix.fileinstall - ServiceEvent REGISTERED
[Framework Event Dispatcher] DEBUG org.eclipse.equinox.cm - BundleEvent STARTED
[org.ops4j.pax.configmanager.internal.Activator] : Starting [org.ops4j.pax.configmanager]...
[Start Level Event Dispatcher] DEBUG org.ops4j.pax.configmanager - ServiceEvent REGISTERED
[org.ops4j.pax.configmanager.internal.ConfigurationAdminFacade] : Using configuration from [configurations]
[org.ops4j.pax.configmanager.internal.ConfigurationAdminFacade] : Using configuration from [configurations]
[org.ops4j.pax.configmanager.internal.ConfigurationAdminFacade] : Register configuration [org.ops4j.pax.logging]

我的问题是:我怎样才能摆脱这个控制台输出?

编辑 1 问这个问题的原因是,理想情况下,我们不应该在启动时在控制台中看到任何内容,除非确实存在问题,或者我们特别要求额外的日志记录。

编辑 2 我注意到我们有一个 apache commons 日志依赖。我认为它会导致某种冲突,所以我删除了它,但输出没有改变。

编辑 3 问题依旧存在,等待反馈。

提前感谢您,如果我在问题格式上犯了任何错误,我们深表歉意。

【问题讨论】:

    标签: logging log4j rcp pax ops4j


    【解决方案1】:

    根据:https://ops4j1.jira.com/wiki/display/paxlogging/Configuration

    您可以使用以下系统属性设置默认级别:

    org.ops4j.pax.logging.DefaultServiceLog.level

    比如启动应用程序:

    -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN
    

    可能是你需要的。

    【讨论】:

      猜你喜欢
      • 2023-02-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-24
      • 1970-01-01
      • 1970-01-01
      • 2017-03-31
      • 1970-01-01
      • 2020-07-12
      相关资源
      最近更新 更多