|Creating logback logger, programatically. [message #1110261]
||Mon, 16 September 2013 16:18
| Daniel McGreal
Registered: January 2013
I'd like to progrmmatically create a logback logger. In the first instance I get a ClassCastException on the following line:
ch.qos.logback.core.LoggerContext context = (ch.qos.logback.core.LoggerContext) LoggerFactory.getILoggerFactory();
which tells me that ch.qos.logback.core.LoggerContext cannot be cast to ch.qos.logback.core.LoggerContext.
Fine, I think to myself, I understand this - the one from the LoggerFactory is made by the kernel, and I've somehow linked to a logback that isn't the same class. Investigating further, I find the culprits and remove them. Only now, my bundle's dependencies are unsatisfactory, with errors importing ch.qos.logback.core, etc.
I found "packageImports" in configuration/org.eclipse.virgo.kernel.userregion.properties which has ch.qos.logback.* inside, the admin console tells me that ch.qos.logback.core is available to be imported, e.g:
Bundle Symbolic Name
uses:=ch.qos.logback.core.spi, ch.qos.logback.core.status, ch.qos.logback.core.helpers, ch.qos.logback.core.filter, ch.qos.logback.core.encoder, ch.qos.logback.core.joran.spi
Many thanks, Dan.
Powered by FUDForum
. Page generated in 0.01987 seconds