blob: d90dee673f502cfb174f897d7eef4225d0c98ece [file] [log] [blame]
h1. Apache ServiceMix console
Now that we successfully installed and started Apache ServiceMix, we'll take a closer look at the console. This is where you manage your ServiceMix instance, add and remove bundles, install optional features, ...
h2. Working with bundles
When ServiceMix is first started, a whole set of bundles providing the core features for the product are being installed. Let's use the command console to find out more about them...
The {{bundle:list}} command can be used to get a list of all bundles currently installed. Enter this
{pygmentize:lang=text}
karaf@root> bundle:list
{pygmentize}
This is what the output looks like if you run this on your ServiceMix instance.
!/quickstart/images/osgi-list.png|title=osgi:list!
For every bundle, you see:
* the bundle id
* the bundle state
* if the bundle contains a Blueprint or Spring XML file, the next 2 columns will show you if the beans defined there were created successfully
* the bundle start level
* the bundle name and version
If you're looking for something specific in the list, you can use unix-like pipes and utilities to help you. An example: to look for all Camel related bundles...
{pygmentize:lang=text}
karaf@root> bundle:list | grep camel
{pygmentize}
!/quickstart/images/osgi-list-pipegrep.png|title=osgi:list!
h2. Working with logging
Many of the applications you write will have some form of log output. To look at the message in the log file, you can us the {{log:diplay}} command.
{pygmentize:lang=text}
karaf@root> log:display
{pygmentize}
!/quickstart/images/log-display.png|title=log:display!
If you're only interested in the latest exception in the log file, you can use {{log:display-exception}} instead.
{pygmentize:lang=text}
karaf@root> log:display-exception
{pygmentize}
!/quickstart/images/log-display-exception.png|title=log:display-exception!
You can also change the log level at runtime by using the {{log:set}} command. You can try these commands on your instance now by first setting the log level to {{DEBUG}} and then using {{grep}} to make sure that you can actually see the extra logging.
{pygmentize:lang=text}
karaf@root> log:set DEBUG
karaf@root> log:display | grep DEBUG
{pygmentize}
!/quickstart/images/log-set-debug.png|title=log:set DEBUG!
Afterwards, revert the log level to its original {{INFO}} value again with {{log:set}}.
{pygmentize:lang=text}
karaf@root> log:set INFO
{pygmentize}
h2. ...and there's a lot more
These are obviously just a few examples of what the command shell is all about. There are a lot more commands in the shell to help you deploy, monitor, manage and troubleshoot the applications you're building with ServiceMix.