Hi, I want to start a discussion about how logging mails in Karaf can be enabled and what's the best way to do this.
Situation: Our software is a web application. We use Karaf as a custom distribution. Fatal errors in our software should not only be logged, but also sent to developers per mail. In order to do this, a log4j SMTPAppender is added to the logging configuration. Setup: The SMTPAppender uses the mail and activation API. The activation API is already part of Karaf (lib/endorsed/org.apache.servicemix.specs.activation-api-1.1-2.4.0.jar). The mail API has to be loaded by the same classloader as the activation API. Otherwise an exception will be thrown. Hence the mail API has to be copied to lib/endorsed and the mail API packages have to be exported by the system bundle. Now both APIs are handled by the same classloader. As our application is a web app, we also install jetty and war feature. Both features transitively require pax-jetty feature, which installs the mail API as a bundle. The mail API exists two times. Problem: When we try to send a log mail, a "javax.activation.UnsupportedDataTypeException: multipart/mixed;" exception is thrown. This problem can easily be fixed by uninstalling the mail API bundle which was added by pax-jetty. The real problem is: This task has to be done manually after first start up, but our software is designed as "install and forget" assembly. What is the best way to enable log mails? I'm not even sure if installing the mail API in lib/endorsed is the correct solution. On the other hand I didn't find another way to enable log mails at all. Can the mail API be excluded from pax-jetty feature e.g. by overwriting the feature? Or can the bundle be uninstalled by a startup script? Regards Jochen -- View this message in context: http://karaf.922171.n3.nabble.com/Discussion-Enabling-logging-mails-in-Karaf-tp4034241.html Sent from the Karaf - User mailing list archive at Nabble.com.
