Wednesday, December 10, 2008

Logging in OSGI Enterprise Applications, Part 6

This part of my blog series "Logging in OSGI Enterprise Applications" will talk about openArchitectureWare 



...and logging with SLF4J / LogBack.


The previous blog entries from this series described logging from the Runtime of an OSGI Enterprise Application. The whole Client / Server Project is model-driven based on Eclipse Modeling Project: EMF, UML2 and as engine the generator framework openArchitectureWare. 


The MDSD - aspects of the application will be part of another blog series.

Now we want to take a look at logging with SLF4J / LogBack while working with openArchitectureWare.

openArchitectureWare (oAW) in Target Platforms

If you want to use oAW in a Target Platform with SLF4J / LogBack as Logging Framework together with bridges to Commons Logging and Log4J, you'll notice some problems: Many of the oAW bundles are using Require - Bundles instead of Import - Packages as dependency to logging bundles.



I opened a Bugzilla, but it seems its too late for 4.3.1.

If you need it now, thanks to PDE its easy: Import Bundles in your Workspace, change Dependencies to Import Package, then export the Bundle als Plug-In again.

openArchitectureWare (oAW) Workflows

There's an own Launcher for oAW Workflows (Run Configurations | oAW Workflow) - we have to change the Classpath:


Click on User Entries and then Add Projects...


...choose the Logging - Projekts from workspace


...and save changes with Apply.

You have to put the logback.xml (or logback-test.xml) directly under src/ into the project which starts the oAWworkflow. In this xml file we configure the logging from the workflow - doesn't matter if the logoutput was originally sent to Log4J, Commons-Logging or OSGI LogServices.

To control please start a Workflow with debug="true" in your logback.xml.



If all is configured right, then the Console will list at first the logback - configuration and then all log - output from the Workflow sent to our configured Appender (Console, Socket, usw)


Blog Series "Logging in OSGI Enterprise Applications":

Part 1: An overview
Part 6: Logging and openArchitectureWare Workflows
Part 7: ... follows (Stay tuned...)

Perhaps some of my older blogs about Logging und OSGI are also interesting:




No comments: