Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSGi compatibility #358

Closed
alexandrul opened this issue Mar 30, 2017 · 9 comments
Closed

OSGi compatibility #358

alexandrul opened this issue Mar 30, 2017 · 9 comments
Labels
Milestone

Comments

@alexandrul
Copy link

Is it possible to add the OSGi compatibility?

For an internal app I was able to use https://github.com/logstash/logstash-logback-encoder without any issues, but for raven-logback all my attempts of wrapping it are ending with:

Could not create an Appender of type [com.getsentry.raven.logback.SentryAppender]
ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type com.getsentry.raven.logback.SentryAppender
java.lang.ClassNotFoundException: com.getsentry.raven.logback.SentryAppender cannot be found by ch.qos.logback.classic_1.2.2
@bretthoerner
Copy link

Hey @alexandrul, you're the first person to ask for this and I'm pretty unfamiliar with OSGi. Do you know much about it? Can you identify any of the ways that sentry-raven needs to change?

@alexandrul
Copy link
Author

alexandrul commented Jun 27, 2017

I have no idea, just that our app needs it.

This section from logstash-logback-encoder's pom.xml seems to specify some mandatory details:

https://github.com/logstash/logstash-logback-encoder/blob/master/pom.xml

<configuration>
	<instructions>
		<!-- packages to export -->
		<Export-Package>net.logstash.logback.encoder,net.logstash.logback.appender</Export-Package>
		<!-- attach to Logback bundle as fragment -->
		<Fragment-Host>ch.qos.logback.classic</Fragment-Host>
		<!-- exclude following imports as required classes are relocated by shade plugin and ignore ch.qos.logback.[core,classic] because this is a fragment and gets them from parent. -->
		<Import-Package>!org.apache.commons.*,!com.lmax.disruptor.*,!ch.qos.logback.classic.*,!ch.qos.logback.core.*,!org.slf4j.*,*</Import-Package>
	</instructions>
</configuration>

@bretthoerner
Copy link

Thanks, can you tell me what application server or framework (or something else?) you are using so that I can try to test this stuff out for myself? I'm pretty clueless here. 😄

@alexandrul
Copy link
Author

I'm using an internal application that in turn uses an internal application container with some roots in Karaf (I think).
I just hope that someone else will encounter the same issue and it will be able to provide much more details.

For error aggregation I have started with logstash-logback-encoder, which required only two things:

  1. copy the jar in the proper folder
  2. update the logback.xml configuration

For sentry-java I was able to find a workaround by using a wrapper that makes it a logback fragment, this operation being required for every new release.

OSGi compatibility would make it a lot easier to use, in my particular case.

@maciejwalkowiak
Copy link
Contributor

While this issue has been solved in 1.7, we currently do not support OSGI in 3.x.

@maciejwalkowiak maciejwalkowiak added this to the Backlog milestone Oct 1, 2020
@maciejwalkowiak maciejwalkowiak added the enhancement New feature or request label Oct 1, 2020
@bruno-garcia
Copy link
Member

Since this was raised over 3 years ago, I wonder what's the priority today.

@alexandrul
Copy link
Author

@bruno-garcia If there aren't at least "n" requests for it, I guess you can just ignore it (where "n" is chosen by you based on the popularity of the other enhancements).

@romtsn
Copy link
Member

romtsn commented Sep 27, 2022

We're gonna close this as there was not activity for 2 years. Please feel free to reopen if there's still a demand.

@romtsn romtsn closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2022
@talios
Copy link

talios commented Sep 27, 2022

I still use it daily from OSGi - basically we're just wrapping sentry and wiring it up to the OSGi LogService.

But it would be good to have the imports/exports back again at a minimum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

9 participants