Configuration (previous)
Change Default Log-Level
Simply provide the "org.ops4j.pax.logging.DefaultServiceLog.level" property as framework or system property. For pax-construct this looks like the following in the pom file you define pax-runner:
<properties> <org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level> </properties>
For pax runner simply use -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN.
Detailed Log Configuration
By default, there is a Root logger created in the Pax Logging Service, which is set to DEBUG level and a fairly extensive output format to the ConsoleAppender.
This configuration may be suitable for the initial startup, and by using the Config Admin Service you can configure logging as you need. The configuration pid used by Pax Logging is org.ops4j.pax.logging. The Dictionary object provided from the Config Admin Service must be the log4j.properties file itself (keys starting with "log4j"). This configuration will be applied across all Loggers.
Deprecation: Pax Logging used to support for each Bundle that it defines two manifest entries, which will provide some default configuration for such client bundle.
- Log4J-LoggerName : Defines the Logger name to be used for the Bundle. If not defined, the Bundle location will be used instead.
- Log4J-ConfigFile : Defines the name of the Log4J configuration file, which contains the default configuration for this bundle. The configuration file is resolved relative to the Bundle classloader, which means that it is typically part of the Bundle itself. Recommended name is log4j.properties sitting in the Bundle jar's root.
Deprecation: Pax Logging used to support that a Pax Logging client connected to the standard OSGi Log Service. This is no longer supported. We will work to improve the the Pax Logging Service to the full spec of the standard OSGi Log Service. This may however still take some time.
Deprecation: Pax Logging used to support Log4J-ConfigFile entry in Dictionary object provided from the Config Admin Service. This is no longer supported. Only entries starting with "log4j" in Dictionary object are used for configuration.