Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » HOW-TO: Logging with the logback Consoleappender and/or custom appenders?(java.lang.ClassNotFoundException: ch.qos.logback.core.Consoleappender)
HOW-TO: Logging with the logback Consoleappender and/or custom appenders? [message #782851] Tue, 24 January 2012 15:21 Go to next message
Jochen Szostek is currently offline Jochen Szostek
Messages: 24
Registered: January 2011
Location: Maasmechelen
Junior Member

Hi all,

I'm experimenting with logging in Virgo, and I'm trying to route the console output of my bundles into the main logging console (like in this thread is mentioned)

But I get:
org.eclipse.virgo.medic.log.impl.logback.LoggerContextConfigurationFailedException: Configuration failed with the following problems: [Could not create an Appender of type [ch.qos.logback.core.Consoleappender]. Caused by java.lang.ClassNotFoundException: ch.qos.logback.core.Consoleappender., ActionException in Action for tag [appender] Caused by ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.core.Consoleappender.]


Do I have to edit the default logback jar MANIFEST.MF (provided by Virgo) and add a fragment host in there? Seems odd as this is a quite default appender type.

I got the idea from reading this btw:
Quote:
Finally, if your appenders are 'static' and you want to guarantee them to be available from the very start, logback does the loading of appenders from its classpath and the appenders need to be on the bundle classpath of the medic bundle. Without modifying medic what you do is to put the appender code in a fragment bundle and define medic as the host fragment. The fragment bundle is then deployed by putting it in the kernel region launch list. This effectively makes it part of the kernel.

If you want to dynamically add your appender to logback (using the addappender api on Logger) then there is no need to have a fragment bundle, just make sure that the appender is added when the appender bundle is started. In this last case, it is still necessary to put the appender code in the kernel launch list -- after the medic bundle.

in the thread here

"The fragment bundle is then deployed by putting it in the kernel region launch list." => does that mean add it to the org.eclipse.virgo.kernel.userregion.properties file? (because logback is already in there)

One last question, if I want to deploy a fully custom appender, would I have to (1) add it to the virgo lib folder and (2) add it to the classpath + (3) add fragment host + (4) add to kernel region launch list?

Thanks a whole lot in advance!

Jochen


Re: HOW-TO: Logging with the logback Consoleappender and/or custom appenders? [message #782861 is a reply to message #782851] Tue, 24 January 2012 15:47 Go to previous message
Lazar Kirchev is currently offline Lazar Kirchev
Messages: 28
Registered: July 2009
Location: Sofia, Bulgaria
Junior Member
Hello Jochen,

What configuration for logback do you use? From the ClassNotFoundException I see that the class Consoleappender cannot be found, but the original class is ch.qos.logback.core.ConsoleAppender, with capital A. Probably somewhere in the configuration it is misspelled?
Previous Topic:CME Group and Virgo
Next Topic:Refresh OSGi bundles programmatically
Goto Forum:
  


Current Time: Tue Sep 23 20:28:30 GMT 2014

Powered by FUDForum. Page generated in 0.02372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software