Search code examples
logginglog4jrcppaxops4j

How to get rid of the logging startup messages in the console when using PAX logging?


I have been asked to implement PAX logging on our RCP application. Basically, I have followed this tutorial.

As you may noticed, it says that when "you run your RCP application, you should see Pax ConfMan logging output to your console". Please note: The configuration folder can be found, that's not the issue.

When I run my application, I get the following console output:

[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]

My question is: how can I get rid of this console output?

Edit 1 The reason for asking this question is that ideally we shouldn't be seeing anything in the console at startup unless there is a genuine problem, or we've specifically requested additional logging.

Edit 2 I have noticed we had an apache commons logging dependency. I assumed that it would cause some sort of conflict, so I removed it, but the output did not changed.

Edit 3 Issue still exists, waiting for any feedback at the moment.

Thank you in advance and apologies if I made any mistake at the question formatting.


Solution

  • According to: https://ops4j1.jira.com/wiki/display/paxlogging/Configuration

    You can set the default level using the following system property:

    org.ops4j.pax.logging.DefaultServiceLog.level

    So something like launching the app with:

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

    is probably what you need.