You can also interact with the OSGi Configuration Admin service from the command console.
To list the configuration currently loaded in the Fuse ESB kernel, type
config:list
at the karaf>
prompt.
Example 3.3. Output of the config:list Command
...
----------------------------------------------------------------
Pid: org.ops4j.pax.logging
BundleLocation: mvn:org.ops4j.pax.logging/pax-logging-service/1.4
Properties:
log4j.appender.out.layout.ConversionPattern = %d{ABSOLUTE} | %-5.5p | %-16.16
t | %-32.32c{1} | %-32.32C %4L | %m%n
felix.fileinstall.filename = org.ops4j.pax.logging.cfg
service.pid = org.ops4j.pax.logging
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} | %-5.5p | %-16
.16t | %-32.32c{1} | %-32.32C %4L | %m%n
log4j.appender.out.layout = org.apache.log4j.PatternLayout
log4j.rootLogger = INFO, out, osgi:VmLogAppender
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.out.file = C:\apache\apache-servicemix-4.4.1-fuse-00-08/data/log/karaf.log
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.out.append = true
log4j.appender.out = org.apache.log4j.FileAppender
----------------------------------------------------------------
Pid: org.ops4j.pax.web
BundleLocation: mvn:org.ops4j.pax.web/pax-web-runtime/0.7.1
Properties:
org.apache.karaf.features.configKey = org.ops4j.pax.web
service.pid = org.ops4j.pax.web
org.osgi.service.http.port = 8181
----------------------------------------------------------------
...
Note the persistent identifier (PID) for any configuration that you want to update.
To edit a particular configuration:
Type
config:edit
PID
To remind yourself of the available properties in a particular configuration, type
config:proplist
.To edit a property, type
config:propset
property
value
To update the configuration in memory and write to the .cfg file, type
config:update
Alternatively, to exit the configuration, without saving your changes, type
config:cancel
Example 3.4. Editing a Configuration
karaf@root> config:edit org.apache.karaf.log
karaf@root> config:proplist
service.pid = org.apache.karaf.log
size = 500
felix.fileinstall.filename = org.apache.karaf.log.cfg
pattern = %d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
karaf@root> config:propset size 300
karaf@root> config:update
For more details on the config commands see Config Console Commands in Console Reference