Creating logback logger, programatically. [message #1110261] |
Mon, 16 September 2013 16:18 |
Daniel McGreal Messages: 12 Registered: January 2013 |
Junior Member |
|
|
Hi Virgorians,
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 Id
3
Bundle Symbolic Name
ch.qos.logback.core
Bundle Version
1.0.0.v20111214-2030
Export Version
1.0.0
Export Directives
x-equinox-ee:=-1
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
x-internal:=false
Export Attributes
--
Any ideas?
Many thanks, Dan.
|
|
|
Powered by
FUDForum. Page generated in 0.03595 seconds