If you haven't done so already, build and deploy your three updated bundles to the releases repository:
bookshelf-inventory-impl-mock
bookshelf-service
bookshelf-service-tui
All with version 1.10.0
.
Then start the newly created bookshelf-log-api
and bookshelf-log-impl
bundles:
g! repos refresh file:///C:/projects/felixbook/releases/repository.xml
g! list book
Bookshelf Inventory API (1.5.0)
Bookshelf Inventory Impl - Mock (1.9.0, ...)
Bookshelf Log Helper API (1.10.0)
Bookshelf Log Helper Impl (1.10.0)
Bookshelf Service (1.10.0, ...)
Bookshelf Service Gogo commands (1.10.0, ...)
The log helpers belong to the "Common Services" layer on start level 1.
g! bundlelevel -i 1
g! deploy -s "Bookshelf Log Helper API"
Target resource(s):
-------------------
Bookshelf Log Helper API (1.10.0)
Deploying...done.
g! deploy -s "Bookshelf Log Helper Impl"
Target resource(s):
-------------------
Bookshelf Log Helper Impl (1.10.0)
Deploying...done.
The bundle listing should be as follows:
g! lb
START LEVEL 5
ID|State |Level|Name
0|Active | 0|System Bundle (3.0.1)
1|Active | 1|Apache Felix Bundle Repository (1.6.2)
2|Active | 1|Apache Felix Gogo Command (0.6.0)
3|Active | 1|Apache Felix Gogo Runtime (0.6.0)
4|Active | 1|Apache Felix Gogo Shell (0.6.0)
5|Active | 2|Apache Felix iPOJO (1.6.4)
6|Active | 2|Bookshelf Inventory Impl - Mock (1.9.0)
7|Active | 2|Bookshelf Inventory API (1.5.0)
8|Active | 3|Bookshelf Service (1.10.0)
9|Active | 3|Bookshelf Log Helper API (1.10.0)
10|Active | 5|Apache Felix iPOJO Gogo Command (1.0.0)
11|Active | 5|Bookshelf Service Gogo commands (1.10.0)
12|Active | 1|Apache Felix Log Service (1.0.0)
13|Active | 1|Bookshelf Log Helper Impl (1.10.0)
If you have not restarted the "Bookshelf Inventory Impl - Mock" since our last change in the previous chapter, a quick search on all authors should give:
g! search admin admin author %
Reference: OSGi Service Platform, Service Compendium, Release 4,
Version 4.1 from OSGi Alliance [6]
Reference: OSGi Service Platform, Core Specification, Release 4,
Version 4.1 from OSGi Alliance [8]
Looking at the last three logs on the Log Reader (output reformatted):
g! log 3 debug
2010.09.22 17:48:10 DEBUG - Bundle:
com.packtpub.felix.bookshelf-log-impl -
LOG_SEARCH_BY_AUTHOR: Searching by author like %
2010.09.22 17:46:03 DEBUG - Bundle:
org.apache.felix.ipojo -
[DEBUG] IPOJO-Extender : Creator thread is waiting - Nothing to do
2010.09.22 17:46:03 INFO - Bundle:
com.packtpub.felix.bookshelf-log-impl -
[INFO] BookshelfLogHelperImpl : Instance bookshelf.log-helper.impl
[INFO] BookshelfLogHelperImpl : Instance bookshelf.log-helper.impl
from factory BookshelfLogHelperImpl created
Programmer's reflex will look at the last line for the latest update. Notice that the newest logs here are on top!
The log entry is typically composed of a time-stamp, the log level, the name of the logging bundle, and the message. For example, the last log entry we have seen previously should be understood as:
2010.09.22 17:48:10
DEBUG
com.packtpub.felix.bookshelf-log-impl
LOG_SEARCH_BY_AUTHOR: Searching by author like %